FeatureFlagRef
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
Example
import type { FeatureFlagRef } from '@nordcom/commerce-db';
function isFlagPopulated(ref: FeatureFlagRef): boolean {
return typeof ref.flag === 'object' && 'key' in ref.flag;
}Related
FeatureFlagService ReviewService ShopService FeatureFlagOption ResolvedCartLineTokens ResolvedProductCardTokens ResolvedShopTheme ShopBase
FeatureFlagOption
One selectable option in a feature flag's options list. Pairs a humanreadable label with a JSONsafe value to support enumstyle flags in the admin UI.
FeatureFlagService
FeatureFlag service backed by the deployed db/featureflags Convex functions. Method signatures preserved from the prior Mongoosebacked service so storefront / a