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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
OpenFeatureProviderOptions |
Returns
Section titled “Returns”Example
Section titled “Example”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" });