Skip to content

Find a component

Loading the directory…

↑ ↓ to select · Enter to open · Esc to closeBrowse all →
Contributor login

Tenants

Application organizations and teams

Bijection source
git clone https://github.com/bijectionhq/tenants.git
cd tenants
git checkout 509ec2fd2b19ec08a9ad19c255b9f6b5d92ee22f

Bijection repository access is required. Request access.

Description

Application organizations and teams

Explore the package README for API concepts, configuration, and examples. Check the Bijection source for adaptation-specific setup.

Available to evaluate

Review the source and its dependencies before adopting this package. Source availability does not establish npm publication or runtime qualification.

Getting started

  1. Get the source at the revision above and read its package documentation.
  2. Check the required Bijection SDK version, dependencies, and external service credentials.
  3. Follow the package setup instructions and the guide to using components.
  4. Exercise the component in your deployment according to your project’s verification rules.

Open source

Maintained source: bijectionhq/tenants. Based on dbjpanda/convex-tenants. License: MIT. Consult the repository for license terms, notices, and contributor attribution.

From the upstream publisher

A multi-tenant organization and team management component for Convex with built-in authorization via @djpanda/convex-authz

Explore the demo ↗

Upstream overview

From the upstream package documentation.

A multi-tenant component that adds organization, team, and member management to Convex applications with built-in authorization via @djpanda/convex-authz. Provides complete CRUD operations for organizations with unique slugs and status management, role-based member management, team creation and membership, and a flexible invitation system. Includes React hooks, UI components, and an organization store for client-side state management.

Use cases

From the upstream package documentation.

  • Building SaaS applications where users need to create and manage organizations with different permission levels for team members
  • Enterprise applications requiring team-based access control with custom roles and hierarchical permissions within organizations
  • Collaborative platforms where users can be members of multiple organizations and switch between different organizational contexts
  • B2B applications needing invitation workflows to onboard new team members with specific roles and team assignments
  • Multi-tenant apps requiring organization suspension and archival capabilities for administrative control

How it works

From the upstream package documentation.

The component integrates with your Convex app by registering tenants and authz in convex.config.ts, then defining permissions and roles in authz.ts using the provided TENANTS_PERMISSIONS and TENANTS_ROLES constants. You create a convex/tenants.ts file that calls makeTenantsAPI() with your auth configuration, which generates a complete set of queries and mutations for organization, member, team, and invitation management.

Authorization is handled through @djpanda/convex-authz with a customizable permission map that defines which permissions are required for each operation. Organizations can have statuses (active, suspended, archived) that automatically block mutations when not active. The invitation system supports flexible identifiers beyond email, with customizable validation callbacks.

On the client side, React applications can use the TenantsProvider and included hooks like useQuery(api.tenants.listOrganizations) to interact with the backend. The component provides pre-built UI components including an organization switcher and management dialogs, plus an organization store that maintains active organization state with configurable storage keys.

Upstream package FAQ

How does convex-tenants handle data isolation between organizations?

The convex-tenants component uses organization-scoped queries and mutations that automatically filter data based on the user's current organization context. It integrates with @djpanda/convex-authz to enforce access control rules at the database level.

Can I customize the roles and permissions in convex-tenants?

Yes, convex-tenants allows you to define custom roles and permissions for both organizations and teams. The component provides a flexible role system that works with the underlying @djpanda/convex-authz authorization framework.

Does convex-tenants support user invitations and team management?

The convex-tenants component includes built-in user invitation flows, team creation, and member management features. It provides Convex mutations and queries for handling the complete lifecycle of multi-tenant user management.

Is convex-tenants compatible with existing Convex authentication?

Yes, convex-tenants works with standard Convex authentication and extends it with organization and team-level authorization. It requires @djpanda/convex-authz as a dependency to provide the authorization layer on top of your existing auth setup.

Use with agents and CLI

Give your coding agent the component’s source identity and setup guidance.

agent-prompt.md
Help me integrate Tenants with Bijection.

Read: https://bijection.com/components/tenants/SKILL.md

Check SDK compatibility and dependency availability.
Follow this project's execution and verification rules.

Upstream README.md

View repository ↗

Documentation from dbjpanda/convex-tenants, recorded October 23, 2026. APIs and setup may differ in the Bijection adaptation.

@djpanda/convex-tenants

A multi-tenant organization and team management component for Convex with flexible, developer-defined authorization via @djpanda/convex-authz.

Features

  • Organizations — Create, update, delete; unique slugs; optional status (active / suspended / archived); transfer ownership; list filtered by status; mutations blocked when org is suspended/archived (reactivate via updateOrganization with status: "active")
  • Members — Add, remove, update roles; roles are flexible strings you define in authz; cursor-based paginated list for large member lists
  • Teams — Create teams with optional slug and metadata; manage membership; paginated lists for teams and for team members
  • Invitations — Flexible identifier-based invitations (email, phone, username, etc.); customizable validation callbacks for create and accept; optional message and team assignment; customizable expiration; paginated list
  • Authorization — Define permissions and roles in authz.ts with @djpanda/convex-authz; customizable permission map
  • React — Hooks, TenantsProvider, and pre-built UI (switcher, members, teams, invitations); organization store with configurable storage key

Installation

npm install @djpanda/convex-tenants @djpanda/convex-authz

For React UI: npm install clsx tailwind-merge (optional peer deps).

Quick Start

  1. Register tenants and authz in convex/convex.config.ts.
  2. Create convex/authz.ts with permissions and roles (use TENANTS_PERMISSIONS / TENANTS_ROLES from this package).
  3. Create convex/tenants.ts with makeTenantsAPI(components.tenants, { authz, auth, getUser, ... }) and export the returned functions.
  4. Use the exported queries/mutations in your app (e.g. useQuery(api.tenants.listOrganizations)).

Full walkthrough: Quick Start.

Documentation

TopicDescription
Quick StartStep-by-step setup and first API usage
API ReferenceAll makeTenantsAPI options and functions
Permission MapDefault permissions per operation and overrides
Flexible RolesCustom roles and structural owner rules
Invitation SystemFlexible identifier validation and examples
Migration GuideBreaking changes and upgrade instructions
React ComponentsTenantsProvider, OrganizationSwitcher, sections, dialogs
Organization StoreActive-org state and configurable storage key

Exported constants

ExportDescription
TENANTS_PERMISSIONSDefault permissions; use with definePermissions() from @djpanda/convex-authz.
TENANTS_ROLESDefault roles (owner, admin, member); use with defineRoles().
DEFAULT_TENANTS_PERMISSION_MAPOperation → permission mapping.
TENANTS_REQUIRED_PERMISSIONSFlat list of permission strings used by default.

License

MIT