Blocks/Team & Workspaces
AdvancedCore

Team & Workspaces

Multi-tenant SaaS with roles and invites

Full multi-tenancy: workspace creation, email-based member invitations with 7-day expiring tokens, role hierarchy (owner/admin/member/viewer), role-checking helpers, and RLS policies that isolate data per workspace. Includes invite accept, removeMember, transferOwnership, updateMemberRole, and workspace settings helpers.

16h
Time saved
385
Lines of code
100%
TypeScript
#multi-tenant#teams#workspaces#invites

Dependencies

@supabase/supabase-jsresend

Code preview

blocks/team/index.ts
1await inviteMember(workspaceId, adminId, 'new@user.com', 'member')
2var(--text-3);font-style:italic">// Sends invite email, generates token, sets 7-day expiry
3
4const role = await getMemberRole(workspaceId, userId)
5var(--text-3);font-style:italic">// β†’ 'owner' | 'admin' | 'member' | 'viewer' | null

Short excerpt. Full block includes SQL migrations, error handling, RLS policies, and complete file structure.

$39

One-time Β· Instant GitHub access

πŸ”œ Payments launching soon

We are setting up secure checkout. Email samarthofficial52@gmail.com to get early access.

You might also like