TenantConfig

tagtree · /core·interface

Declares how a tenant value maps to a cache-key prefix; the key function serializes the tenant to its string segment, while extraTags injects additional per-tenant invalidation tags such as a shop's custom domain alias.

Properties

type
T
Phantom field carrying the TypeScript type of the tenant value for inference.
key
unknown
extraTags?
unknown

Example

const tenant: TenantConfig<Shop> = {
    type: {} as Shop,
    key: (shop) => shop.id,
    extraTags: (shop) => shop.domains,
};

ContractTestOptions runAdapterContract AdapterCtx CacheAdapter CacheInstance CacheKey CacheSchema CacheSchemaShape

Sourceschema.ts:17Edit the JSDoc directly

On this page