tenant
Registers the three core multi-tenancy entities — tenant, tenant-membership, and tenant-invitation (DB tables read_tenants, read_tenant_memberships, and read_tenant_invitations) — along with write handlers for create/update/disable/enable/addMember/removeMember/updateMemberRoles and the matching queries. It also declares a set of per-tenant config keys (companyName, timezone, locale, SMTP credentials) and system-only keys (priceModel, maxUsers) via r.config({ keys: { ... } }). Use this feature in every multi-tenant app; membership resolution and invitation flows depend on it, and auth-email-password requires it.
Live preview
Section titled “Live preview”
How it fits
Section titled “How it fits”What this feature needs to run (Requires, top) and the write commands this feature provides (Provides, bottom).
flowchart TB
n_tenant["tenant"]
subgraph how_reqs["Requires"]
n_config["config"]
end
subgraph how_provides["Provides"]
n_cmd_tenant_write_add_member(["add-member"])
n_cmd_tenant_write_cancel_invitation(["cancel-invitation"])
n_cmd_tenant_write_create(["create"])
n_cmd_tenant_write_disable(["disable"])
n_cmd_tenant_write_enable(["enable"])
n_cmd_tenant_write_remove_member(["remove-member"])
n_cmd_more(["+3 more"])
end
n_config --> n_tenant
n_tenant --> n_cmd_tenant_write_add_member
n_tenant --> n_cmd_tenant_write_cancel_invitation
n_tenant --> n_cmd_tenant_write_create
n_tenant --> n_cmd_tenant_write_disable
n_tenant --> n_cmd_tenant_write_enable
n_tenant --> n_cmd_tenant_write_remove_member
n_tenant --> n_cmd_more
Provides — write commands this feature registers (dispatch them through the command bus):
tenant:write:add-membertenant:write:cancel-invitationtenant:write:createtenant:write:disabletenant:write:enabletenant:write:remove-membertenant:write:tenant:updatetenant:write:updatetenant:write:update-member-roles
Dependencies
Section titled “Dependencies”- Requires:
config - Activation: always on (not toggleable)
Configuration
Section titled “Configuration”Per-tenant config keys, set via the tenant-admin UI or a seed. 🔒 = encrypted at rest.
| Key | Type | Default | Scope | Who can write | Who can read |
|---|---|---|---|---|---|
company-name | text | "" | tenant | TenantAdmin, Admin, SystemAdmin | all |
locale | select (de | en | fr | es) | de | tenant | TenantAdmin, Admin, SystemAdmin | all |
max-users | number | 50 | system | system | TenantAdmin, Admin, SystemAdmin |
price-model | select (basic | pro | enterprise) | basic | system | system | TenantAdmin, Admin, SystemAdmin |
smtp-host | text | — | tenant | SystemAdmin | TenantAdmin, Admin, SystemAdmin |
smtp-pass | text | — | tenant 🔒 | SystemAdmin | SystemAdmin |
timezone | select (UTC | Europe/Berlin | Europe/London | Europe/Paris | Europe/Madrid | Europe/Rome | America/New_York | America/Los_Angeles | America/Sao_Paulo | Asia/Tokyo | Asia/Singapore | Australia/Sydney) | Europe/Berlin | tenant | TenantAdmin, Admin, SystemAdmin | all |