FeatureFlagRef

db · /index·interface

Embedded reference in a shop's featureFlags array. The Convex-backed seam always resolves the shopFeatureFlags join, so flag arrives as the full FeatureFlagBase document; the legacy unpopulated-ref arm of the union (now the structural LegacyObjectIdRef, since the mongoose ObjectId class left with TEARDOWN-04) is retained because consumers (e.g. the storefront's flag evaluator) narrow by shape — typeof flag === 'object' && 'key' in flag — and must keep compiling against historical unpopulated refs.

Properties

flag
LegacyObjectIdRef | FeatureFlagBase

Example

import type { FeatureFlagRef } from '@nordcom/commerce-db';
function isFlagPopulated(ref: FeatureFlagRef): boolean {
    return typeof ref.flag === 'object' && 'key' in ref.flag;
}

FeatureFlagService ReviewService ShopService FeatureFlagOption ResolvedCartLineTokens ResolvedProductCardTokens ResolvedShopTheme ShopBase

Sourceshop.ts:99Edit the JSDoc directly
Metadata@nordcom/commerce-db@0.1.0Open in GitHub ↗

On this page