function getTenantCachePrefix
getTenantCachePrefix(ctx: { state: Map<string, unknown>; }): string | undefined

Exported accessor that reads the cache-prefix stamped into ctx.state by the middleware. Consumers never hardcode the state key string.

Parameters

ctx: { state: Map<string, unknown>; }

Must expose a state: Map<string, unknown> (satisfied by IRequestContext).

Return Type

string | undefined

The prefixed cache key, or undefined when not configured.

Usage

import { getTenantCachePrefix } from "multi-tenancy-plugin/src/index.ts";