Skip to content

createOpenFeatureProvider

function createOpenFeatureProvider(options): XtandardOpenFeatureProvider;

Defined in: openfeature.ts:277

Create a storage-backed, memory-first OpenFeature provider.

The provider loads the active snapshot into memory on initialize and refreshes it in the background. All flag resolution reads from memory only.

Parameter Type
options OpenFeatureProviderOptions

XtandardOpenFeatureProvider

import { OpenFeature } from "@openfeature/server-sdk";
import { createOpenFeatureProvider } from "@xtandard/flags/openfeature";
const provider = createOpenFeatureProvider({ storage });
await OpenFeature.setProviderAndWait(provider);
const client = OpenFeature.getClient();
const enabled = await client.getBooleanValue("new-dashboard", false, { targetingKey: "u1" });