@featureflip/openfeature-node
OpenFeature provider for
Featureflip, backed by the @featureflip/node
server SDK.
Installation
npm install @openfeature/server-sdk @featureflip/node @featureflip/openfeature-node
@openfeature/server-sdk and @featureflip/node are peer dependencies — your
application installs and owns a single copy of each, so the provider shares one
underlying Featureflip client core with any direct SDK usage.
Usage
import { OpenFeature } from '@openfeature/server-sdk';
import { FeatureflipProvider } from '@featureflip/openfeature-node';
await OpenFeature.setProviderAndWait(
new FeatureflipProvider({ sdkKey: 'your-server-sdk-key' }),
);
const client = OpenFeature.getClient();
const enabled = await client.getBooleanValue('my-flag', false, {
targetingKey: 'user-42',
});
The constructor accepts either a Featureflip config object or an existing
FeatureflipClient instance.
targetingKey maps to Featureflip's user_id
- Matched variation keys surface as
variant; ruleId / prerequisiteKey
surface in flagMetadata
- OpenFeature
track() calls forward to Featureflip custom events
Full documentation: https://featureflip.io/docs/integrations/openfeature/
License
Apache-2.0