Alokai

withStorefrontScope

Wraps a storefront logger so every entry carries scope under the reserved alokai namespace - the designed place for per-log detail (request path, route, framework tag, ...). Unlike the raw metadata injector, this only ever writes alokai.scope, so callers cannot override the protected alokai.context. Framework integrations (Next.js, Nuxt) use it to enrich SSR error and console-bridge entries without widening the logger's public surface.

Signature

declare function withStorefrontScope(
	logger: LoggerInterface,
	scope: Record<string,
	unknown>
): LoggerInterface;

Parameters

NameRequiredTypeDescription
loggerRequiredLoggerInterface
scopeRequiredRecord<string, unknown>

Referenced Types

On this page