@xtandard/entitlements/flags
The flags bridge (ADR 0008): entitlementsContext (flat evaluation-context
attributes), createEntitlementsHook (an OpenFeature hook that enriches
every evaluation) and createEntitlementsProvider (an OpenFeature provider
over entitlements). No runtime dependency on @openfeature/server-sdk or
@xtandard/flags.
import { … } from "@xtandard/entitlements/flags";Functions
Section titled “Functions”| Name | Summary |
|---|---|
createEntitlementsHook |
An OpenFeature hook that enriches every evaluation context with the customer’s entitlement attributes (attributes already in the context win). |
createEntitlementsProvider |
An OpenFeature provider backed by entitlements: flag key = feature key, targeting key = customer. |
entitlementsContext |
Build flat entitlement attributes for a customer, ready to merge into a flags evaluation context. |
toOpenFeatureReason |
Map a decision to an OpenFeature reason: STALE when served stale, DEFAULT for fallbacks. |
Interfaces
Section titled “Interfaces”| Name | Summary |
|---|---|
EntitlementsContextOptions |
Options for entitlementsContext. |
EntitlementsHookOptions |
Options for createEntitlementsHook. |
EntitlementsOpenFeatureProvider |
The provider returned by createEntitlementsProvider (structurally an OpenFeature Provider). |
EntitlementsProviderOptions |
Options for createEntitlementsProvider. |
Type aliases
Section titled “Type aliases”| Name | Summary |
|---|---|
EntitlementsContextAttributes |
Flat evaluation-context attributes produced by entitlementsContext. |
EntitlementsContextFn |
Builds the attributes for one customer. |