Configure multi-tenant organizations, manage members and invitations, define custom roles and permissions, set up teams, and implement RBAC using Better Auth's…
Multi-tenant organization setup with member management, role-based access control, and team support via Better Auth.
Configure organizations with customizable creation rules, membership limits, and ownership constraints; creators automatically receive the owner role
Manage members and invitations with email delivery, expiration windows, and shareable invitation URLs; support multiple roles per member
Define custom roles and permissions with dynamic access control; check permissions server-side via hasPermission endpoint or client-side via checkRolePermission
Create and manage teams within organizations with configurable member and team limits; set active teams to scope API calls
Use lifecycle hooks (beforeCreate, afterCreate, beforeDelete) and schema customization to extend default behavior and integrate with external systems
Setup
Add organization() plugin to server config
Add organizationClient() plugin to client config
Run npx @better-auth/cli@latest migrate (built-in adapter) or generate + push for Drizzle/Prisma
Verify: check that organization, member, invitation tables exist in your database
import { betterAuth } from "better-auth";
import { organization } from "better-auth/plugins";don't have the plugin yet? install it then click "run inline in claude" again.