Feature request: Support multiple independent instances of the organization plugin #2784

Open
opened 2026-03-13 10:20:08 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @NGR-NP on GitHub (Jan 29, 2026).

Is this suited for github?

  • Yes, this is suited for github

I’m often blocked when building real-world apps because the Better Auth organization plugin can only be used once per app and is tightly coupled to a single domain named organization.

In practice, many applications need multiple independent domains that behave like organizations (each with members, roles, teams, and invitations), such as businesses, events, or projects. With the current design, these domains cannot be modeled cleanly without duplicating logic or mixing unrelated concepts together.

Describe the solution you'd like

Allow the organization plugin to be instantiated multiple times within a single Better Auth configuration, where each instance represents a separate “organization-like” domain (for example: organization, business, event).

Each instance should:

  • Have isolated data (separate tables/models)
  • Expose its own API namespace on both server and client
  • Reuse the same core behavior (members, roles, teams, invites, access control)

Conceptually, this would turn the current organization plugin into a reusable base module, instead of a globally singleton feature. The exact API and configuration details can be decided by the maintainers.

Describe alternatives you've considered

  • Duplicating the organization plugin per domain
    Copying and renaming models and logic (e.g. Organization → Business, Membership → EventMember).
    This works but causes heavy code duplication, painful upgrades, and long-term maintenance issues.

  • Flattening everything into a single organization domain
    Using one organization table with flags or polymorphic fields for businesses, events, etc.
    This mixes unrelated rules, complicates access control, and makes the data model harder to reason about.

  • Building custom membership systems per domain
    Implementing members, roles, and invites separately for each domain.
    This avoids coupling but loses the benefits of a shared, well-tested implementation.

None of these alternatives provides clean reuse with proper isolation.

Additional context

The existing organization plugin already provides a strong foundation (members, roles, teams, invitations, access control). Enabling it to be multi-instance would significantly improve flexibility for multi-domain and multi-tenant applications without requiring developers to fork or reimplement core logic.

I’d be happy to help discuss design options, provide examples, or test an implementation if this aligns with the project’s direction.

Originally created by @NGR-NP on GitHub (Jan 29, 2026). ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. I’m often blocked when building real-world apps because the Better Auth `organization` plugin can only be used **once per app** and is tightly coupled to a single domain named `organization`. In practice, many applications need **multiple independent domains that behave like organizations** (each with members, roles, teams, and invitations), such as **businesses**, **events**, or **projects**. With the current design, these domains cannot be modeled cleanly without duplicating logic or mixing unrelated concepts together. ### Describe the solution you'd like Allow the `organization` plugin to be **instantiated multiple times within a single Better Auth configuration**, where each instance represents a separate “organization-like” domain (for example: `organization`, `business`, `event`). Each instance should: * Have **isolated data** (separate tables/models) * Expose its own **API namespace** on both server and client * Reuse the same core behavior (members, roles, teams, invites, access control) Conceptually, this would turn the current organization plugin into a **reusable base module**, instead of a globally singleton feature. The exact API and configuration details can be decided by the maintainers. ### Describe alternatives you've considered * **Duplicating the organization plugin per domain** Copying and renaming models and logic (e.g. `Organization → Business`, `Membership → EventMember`). This works but causes heavy code duplication, painful upgrades, and long-term maintenance issues. * **Flattening everything into a single organization domain** Using one organization table with flags or polymorphic fields for businesses, events, etc. This mixes unrelated rules, complicates access control, and makes the data model harder to reason about. * **Building custom membership systems per domain** Implementing members, roles, and invites separately for each domain. This avoids coupling but loses the benefits of a shared, well-tested implementation. None of these alternatives provides clean reuse with proper isolation. ### Additional context The existing organization plugin already provides a strong foundation (members, roles, teams, invitations, access control). Enabling it to be **multi-instance** would significantly improve flexibility for multi-domain and multi-tenant applications without requiring developers to fork or reimplement core logic. I’d be happy to help discuss design options, provide examples, or test an implementation if this aligns with the project’s direction.
GiteaMirror added the enhancement label 2026-03-13 10:20:08 -05:00
Author
Owner

@better-auth-agent[bot] commented on GitHub (Jan 29, 2026):

Thank you for your feature request concerning the Better Auth organization plugin! Currently, the plugin is designed as a singleton instance which limits its use to one per app. You've highlighted a common situation where users require multiple independent domains that can behave like organizations.

This feature would indeed add significant flexibility for applications that need to manage various organizational characteristics distinctly, like businesses, events, or projects.

Presently, while there isn't an implementation for allowing multiple instances directly, there are discussions and open issues regarding the restructuring of the organization plugin to enhance flexibility and potentially allow such a feature in the future [1][2].

For the latest updates and potential collaboration on this feature, I recommend keeping an eye on ongoing developments within our project or reaching out to the Better Auth team members, Beka and Max (@bekacru and @ping__), for further assistance.

Do you have a specific use case or an example of how you'd like to implement these multiple instances? That might help clarify the need!

If you need more help, tag @better-auth-agent in a comment so I can respond.

DiagramDiscordGitHub

Diagram Join Star

@better-auth-agent[bot] commented on GitHub (Jan 29, 2026): Thank you for your feature request concerning the Better Auth `organization` plugin! Currently, the plugin is designed as a singleton instance which limits its use to one per app. You've highlighted a common situation where users require multiple independent domains that can behave like organizations. This feature would indeed add significant flexibility for applications that need to manage various organizational characteristics distinctly, like businesses, events, or projects. Presently, while there isn't an implementation for allowing multiple instances directly, there are discussions and open issues regarding the restructuring of the organization plugin to enhance flexibility and potentially allow such a feature in the future [[1]](https://github.com/better-auth/better-auth/pull/3486)[[2]](https://github.com/better-auth/better-auth/issues/6270). For the latest updates and potential collaboration on this feature, I recommend keeping an eye on ongoing developments within our project or reaching out to the Better Auth team members, Beka and Max (@bekacru and @ping__), for further assistance. Do you have a specific use case or an example of how you'd like to implement these multiple instances? That might help clarify the need! _If you need more help, tag @better-auth-agent in a comment so I can respond._ <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) • [Discord](https://discord.gg/better-auth) • [GitHub](https://github.com/better-auth/better-auth) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/better-auth) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/better-auth/better-auth)
Author
Owner

@bytaesu commented on GitHub (Jan 31, 2026):

Hi @NGR-NP,

We're currently rewriting the Organization plugin. Once the bare-bones structure is stabilized, yes we can try extracting it into a reusable architecture.

For now, it would be quite difficult 🤔

@bytaesu commented on GitHub (Jan 31, 2026): Hi @NGR-NP, We're currently rewriting the Organization plugin. Once the bare-bones structure is stabilized, yes we can try extracting it into a reusable architecture. For now, it would be quite difficult 🤔
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#2784