MiddlewareConfig
interface MiddlewareConfig {
discoveryApi: DiscoveryApiConfig;
legacy?: LegacyApiConfig;
resolveDomainKey?: (context: DiscoveryApiResolverContext) => string | undefined;
resolveTrackingParams?: (context: DiscoveryApiResolverContext) => {
brUid2?: string;
refUrl?: string;
url?: string;
};
resolveViewId?: (context: DiscoveryApiResolverContext) => string | undefined;
}Properties
| Name | Required | Type | Description |
|---|---|---|---|
discoveryApi | Required | DiscoveryApiConfig | Configuration for the new Discovery API (generated from OpenAPI specs). |
legacy | Optional | LegacyApiConfig | Configuration for the legacy API (GraphQL-based). |
resolveDomainKey | Optional | (context: DiscoveryApiResolverContext) => string | undefined | Dynamically resolve domain_key per request. Overrides the static DiscoveryApiConfig.domainKey when provided. Return undefined to use the static default. |
resolveTrackingParams | Optional | (context: DiscoveryApiResolverContext) => { brUid2?: string; refUrl?: string; url?: string; } | Dynamically resolve Bloomreach tracking parameters (brUid2, url, ref_url) per request. When omitted, values are extracted from the incoming request headers and cookies automatically by the proxy layer. |
resolveViewId | Optional | (context: DiscoveryApiResolverContext) => string | undefined | Dynamically resolve view_id per request. Maps locale + currency to a Bloomreach view for currency-specific pricing. Return undefined to omit view_id (uses default view). |