Tenants
Application organizations and teams
git clone https://github.com/bijectionhq/tenants.git
cd tenants
git checkout 509ec2fd2b19ec08a9ad19c255b9f6b5d92ee22fBijection 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.
Review the source and its dependencies before adopting this package. Source availability does not establish npm publication or runtime qualification.
Getting started
- Get the source at the revision above and read its package documentation.
- Check the required Bijection SDK version, dependencies, and external service credentials.
- Follow the package setup instructions and the guide to using components.
- 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.
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 viaupdateOrganizationwithstatus: "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.tswith@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
- Register
tenantsandauthzinconvex/convex.config.ts. - Create
convex/authz.tswith permissions and roles (useTENANTS_PERMISSIONS/TENANTS_ROLESfrom this package). - Create
convex/tenants.tswithmakeTenantsAPI(components.tenants, { authz, auth, getUser, ... })and export the returned functions. - Use the exported queries/mutations in your app (e.g.
useQuery(api.tenants.listOrganizations)).
Full walkthrough: Quick Start.
Documentation
| Topic | Description |
|---|---|
| Quick Start | Step-by-step setup and first API usage |
| API Reference | All makeTenantsAPI options and functions |
| Permission Map | Default permissions per operation and overrides |
| Flexible Roles | Custom roles and structural owner rules |
| Invitation System | Flexible identifier validation and examples |
| Migration Guide | Breaking changes and upgrade instructions |
| React Components | TenantsProvider, OrganizationSwitcher, sections, dialogs |
| Organization Store | Active-org state and configurable storage key |
Exported constants
| Export | Description |
|---|---|
TENANTS_PERMISSIONS | Default permissions; use with definePermissions() from @djpanda/convex-authz. |
TENANTS_ROLES | Default roles (owner, admin, member); use with defineRoles(). |
DEFAULT_TENANTS_PERMISSION_MAP | Operation → permission mapping. |
TENANTS_REQUIRED_PERMISSIONS | Flat list of permission strings used by default. |
License
MIT