skills.vishalvoidskills/vishalvoid
Technical & DevelopmentAdvanced

organization-best-practices

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.

Developer Setup

Setup & Installation

bash
npx skills add https://github.com/better-auth/skills --skill organization-best-practices

Overview

What This Skill Does

Implements multi-tenant teams and organizations, role-based access control (RBAC), user invitations, and active organization scoping for subsequent API requests.

Application

When to use this Skill

Documentation

Show Skills.md file

Better Auth Organization Setup

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
    }),
  ],
});

Client-Side Setup

Lines 1 - 25 of 134

Recommendations

Explore other random skills

All skillsMy patterns