organization-best-practices

Installation
Summary

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
SKILL.md

Setup

  1. Add organization() plugin to server config
  2. Add organizationClient() plugin to client config
  3. Run npx @better-auth/cli migrate
  4. Verify: check that organization, member, invitation tables exist in your database
import { betterAuth } from "better-auth";
import { organization } from "better-auth/plugins";

export const auth = betterAuth({
  plugins: [
    organization({
      allowUserToCreateOrganization: true,
      organizationLimit: 5, // Max orgs per user
      membershipLimit: 100, // Max members per org
    }),
  ],
Related skills

More from better-auth/skills

Installs
14.5K
GitHub Stars
190
First Seen
Feb 10, 2026