Top-level options for MultiTenancyPlugin.
Which resolver(s) to use for tenant resolution (required).
subdomain: SubdomainResolverOptions
Options forwarded to SubdomainResolver.
header: HeaderResolverOptions
Options forwarded to HeaderResolver.
path: PathResolverOptions
Options forwarded to PathResolver.
jwt: JwtResolverOptions
Options forwarded to JwtResolver.
Security note: the resolver reads the tenant id from an UNVERIFIED JWT
claim — a client can mint a token naming any tenant. Acceptable only
alongside authentication middleware which separately verifies the token.
A register() warning fires when the resolved chain contains a
JwtResolver.
database: DatabaseStrategyKind | ITenantIsolationStrategy
Database-isolation strategy: a discriminant string, or a custom
ITenantIsolationStrategy instance.
Default: 'column-per-tenant'.
A strategy NAMES the isolation an ITenantDataStore is expected
to implement; it does not by itself create schemas or databases. The
shipped MemoryTenantDataStore uses the strategy's label as a
partition-map key, so all three kinds isolate correctly on it — but no
shipped adapter is told the strategy. A register() warning fires when a
non-'column-per-tenant' strategy is selected with no dataStore.
dataStore: ITenantDataStore
An application-provided data store. When absent the plugin ships
a zero-dependency MemoryTenantDataStore.
cache: TenantCacheOptions
Cache-prefix behaviour.
required: boolean
When true and no resolver returns a tenant, short-circuit with an
error response. Default: false.
rejectionStatus: number
HTTP status code returned when short-circuiting (default 400).
middlewarePriority: number
Priority passed to ctx.middleware.add (default 40).
exclude: readonly PathPattern[]
Paths that skip tenant resolution entirely — no resolver runs, no tenant
is stamped, and a required deployment does not reject them. Matched
against ctx.request.path by exact string equality or RegExp.test.
Default when omitted: the operational probes the framework's own plugins
serve — ['/live', '/ready', '/health', '/metrics', '/openapi.json', '/docs']. A matching path goes straight to next(). Pass [] to restore
the previous behaviour (no path is exempt) for an application whose own
routes sit on those paths.