What problem does it solve?
Configure multi-tenant organizations, manage members and invitations, define custom roles and permissions, set up teams, and implement RBAC using Better Auth's organization plugin. Use when users need org setup, team management, member roles, access control, or the Better Auth organization plugin.
Core Features & Use Cases
- Setup: Add organization() plugin to server config, add organizationClient() plugin to client config, run migrations, and verify that organization, member, invitation tables exist in your database.
- Creating Organizations: The creator is automatically assigned the owner role and can manage creation policies, invitations, and memberships.
- Active Organizations: Stored in the session and scopes subsequent API calls. Set active organization with a dedicated setter.
- Members: Add and manage members with roles; update member roles and enforce membership limits.
- Invitations: Configure invitation emails and generate shareable invitation URLs.
- Roles & Permissions: Create and manage custom roles with granular permissions; check permissions for UI rendering and server checks.
- Teams: Enable teams, create teams, manage team members, and set active teams with per-team member limits.
- Dynamic Access Control: Enable dynamic access control and define custom roles with per-resource permissions.
- Lifecycle Hooks: Define before/after hooks for organization, member, and invitation lifecycles to customize behavior.
- Schema Customization: Override schema for organizations and members, including custom field mappings and additional fields.
- Security Considerations: Enforce owner protections, secure deletion lifecycle, and robust invitation security.
- Complete Configuration Example: A comprehensive integrated setup illustrating all options.
Quick Start
Use the pdf skill to extract all text from the attached file 'invoice-q3.pdf'.