Loading...
FastStaq ships single-tenant by default, which is the right choice for most products. When you need isolated customer workspaces (teams, organizations), you can turn on multi-tenancy.
Enable workspaces when customers should have separate, isolated spaces with their own members and project resources, for example a B2B tool where each company is a tenant. If your product is per-user, you do not need this.
By default FastStaq keeps billing and credits user-level. Workspace scoping is applied to project resources such as API keys, outbound webhooks, and canned responses. This keeps the common case simple while still isolating tenant data.
Multi-tenancy is gated by a server flag and a matching client flag, which must be flipped together:
# server/.env
MULTI_TENANT=true
# (or the TENANCY_MULTI_TENANT override)
# client/.env (baked at build time)
NEXT_PUBLIC_MULTI_TENANT=true
While the flag is off, the tenant-scope middleware is a no-op. Enabling it activates workspace scoping, per-workspace websocket rooms, and tenant resolution.
Tenants can be resolved by subdomain, header, or JWT (TENANCY_RESOLVERS). Set TENANCY_ROOT_DOMAIN for subdomain routing. Avoid the query-string resolver in production unless you explicitly allow it.
Enabling tenancy is not just a flag flip in a live system; plan a paired rollout:
Rebuild and redeploy the client because NEXT_PUBLIC_MULTI_TENANT is baked in at build time; restart the API to pick up the server flag.
Open a support ticket before enabling tenancy on a live database.
Sign in to leave feedback on this article.