Organizations

Create and manage organization accounts for team collaboration.

Build multi-tenant team workspaces where users create organizations, invite members, assign roles, and collaborate - with dedicated billing per organization.

Organizations in the Next.js Prisma kit enable multi-tenant team workspaces where users create shared accounts, invite members, and assign roles. Each organization has isolated data, dedicated billing, and independent settings. This model supports B2B SaaS applications requiring team collaboration with role-based access control.

Organizations are shared workspaces independent of any single user. Multiple users join as members with assigned roles. Each organization has its own settings, billing, and data isolation.

  • Use organizations when: you're building B2B SaaS, team collaboration tools, or any app where multiple users share a workspace.
  • Use personal accounts only when: you're building a B2C app where users work individually without sharing data.

Features

FeatureDescription
Organization CRUDCreate, update, and delete organizations
Member managementInvite, remove, and manage team members
Role-based accessAssign roles (owner, admin, member) with permissions
Account switcherNavigate between personal and organization contexts
Dedicated billingPer-organization subscriptions and invoices
Authorization policiesCustom business rules for organization operations

Documentation Structure

PagePurpose
Organization ConceptHow organizations fit into the account model
DashboardOrganization workspace and customization
Account SwitcherNavigate between accounts
SettingsOrganization profile and danger zone
Authorization PoliciesCustom rules for org operations

Routes

Organizations share routes with personal accounts. The active context is determined by application state, not URL parameters.

RoutePurpose
/dashboardOrganization dashboard
/settingsOrganization settings
/settings/membersMember management
/settings/rolesRole management
/settings/subscriptionBilling and subscription

Common Pitfalls

  • Forgetting account mode configuration: If organizations don't appear, check Account Modes is set to hybrid or organizations-only.
  • Assuming URL-based routing: Organizations don't use URL slugs like /org/acme. The active organization is stored in context/state.
  • Not checking workspace context: Always use useTeamAccountWorkspace() hook in team components to access current organization data.
  • Mixing personal and team contexts: Personal account pages use useUserWorkspace(), organization pages use useTeamAccountWorkspace(). Don't mix them.

Frequently Asked Questions

Can a user belong to multiple organizations?
Yes. Users can create and join multiple organizations. They switch between them using the account switcher in the sidebar.
What happens when I delete an organization?
The organization and all its data are permanently deleted. Active subscriptions must be cancelled first. Only owners can delete organizations.
How do I limit the number of organizations a user can create?
Use Authorization Policies. Register a policy on organizationCreateRegistry that checks the user's current organization count.
Can I disable personal accounts entirely?
Yes. Set account mode to organizations-only in your configuration. Users will only see organizations in the account switcher.

Next: Organization Concept →