organization-best-practices

Configure Better Auth organization plugin for multi-tenant SaaS with RBAC.

Updated Dec 20, 2023
One-click install
npx skills add https://github.com/Thiago-Cruz-eng/Hibrygame --skill organization-best-practices-thiago-cruz-eng
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: organization-best-practices
Source: https://github.com/Thiago-Cruz-eng/Hibrygame/tree/main/.claude/skills/organization-best-practices
Command: npx skills add https://github.com/Thiago-Cruz-eng/Hibrygame --skill organization-best-practices-thiago-cruz-eng

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the challenge of building a secure, scalable multi-tenant organization system by guiding you through Better Auth’s organization plugin setup, member management, invitations, teams, and role-based access control.

Core Features & Use Cases

  • Configure multi-tenant organizations with limits: Set rules for how many organizations a user can create and how many members each organization can hold.
  • Manage members, roles, and permissions: Assign default and custom roles, update roles, and enforce access checks for actions like member management.
  • Handle invitations securely: Enable invitation email delivery, configure expiration and limits, and generate shareable invitation URLs.
  • Organize users with teams and team membership: Enable teams, create them, add/remove team members, and set active teams.
  • Add dynamic access control and custom roles: Turn on dynamic access control and define granular permissions for roles.
  • Harden lifecycle and schema behavior: Use hooks for create/delete/member/invitation events and customize schema/table fields for your data model.

Quick Start

Follow the steps to add the Better Auth organization plugin on the server, add the corresponding client plugin, run the migration command, and verify the required organization-related tables exist in your database.

Frequently Asked Questions about organization-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up multi-tenant organizations with Better Auth?

To set up multi-tenant organizations with Better Auth, you must configure the server and client organization plugins, run database migrations, and verify the required tables exist in your database.

How do I manage member roles and permissions in a Better Auth organization?

You can manage member roles and permissions by assigning default or custom roles, updating member roles, and enforcing access checks for specific actions like member management within the organization plugin.

Can I limit how many organizations a user can create with Better Auth?

Yes, you can configure multi-tenant organizations with limits by setting specific rules for how many organizations a user can create and how many members each organization can hold.

How do I handle secure invitations for new members in Better Auth?

You handle secure invitations by configuring expiration and limits, enabling invitation email delivery, and generating shareable invitation URLs directly through the Better Auth organization plugin.

Does Better Auth support dynamic access control and custom roles for SaaS applications?

Yes, Better Auth supports dynamic access control for SaaS scenarios by allowing you to turn on dynamic access control and define granular permissions for default and custom roles.

Can I organize users into teams within a Better Auth multi-tenant organization?

Yes, you can enable teams, create them, add or remove team members, and set active teams to organize users within your multi-tenant organization setup.