Setu-TS
    Preparing search index...

    Interface MultiTenancyPluginOptions

    Top-level options for MultiTenancyPlugin.

    interface MultiTenancyPluginOptions {
        cache?: TenantCacheOptions;
        database?: ITenantIsolationStrategy | DatabaseStrategyKind;
        dataStore?: ITenantDataStore | RegistryFactory<ITenantDataStore>;
        exclude?: readonly PathPattern[];
        header?: HeaderResolverOptions;
        jwt?: JwtResolverOptions;
        middlewarePriority?: number;
        path?: PathResolverOptions;
        rejectionStatus?: number;
        required?: boolean;
        resolver: ResolverConfig;
        subdomain?: SubdomainResolverOptions;
    }
    Index

    Cache-prefix behaviour.

    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. The shipped DatabaseTenantDataStore bridge (from @setu-ts/database-plugin) is told the strategy and implements 'column'; it throws TenantStoreStrategyUnsupportedError for 'schema' and 'database'. A register() warning fires when a non-'column-per-tenant' strategy is selected with no dataStore.

    An application-provided data store. When absent the plugin ships a zero-dependency MemoryTenantDataStore.

    Accepts a store instance (validated and used in register()) or a RegistryFactory (M101c, V8-8) resolved in onInit through resolveRegistryEntry — the M70d arm for a store that must read a capability, such as createDatabaseTenantDataStore() from @setu-ts/database-plugin, which resolves CAPABILITIES.DATABASE from the registry it is handed.

    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.

    Options forwarded to HeaderResolver.

    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.

    middlewarePriority?: number

    Priority passed to ctx.middleware.add (default 40).

    Options forwarded to PathResolver.

    rejectionStatus?: number

    HTTP status code returned when short-circuiting (default 400).

    required?: boolean

    When true and no resolver returns a tenant, short-circuit with an error response. Default: false.

    resolver: ResolverConfig

    Which resolver(s) to use for tenant resolution (required).

    Options forwarded to SubdomainResolver.