@featureflip/openfeature-node
v0.3.2
Published
OpenFeature provider for Featureflip (Node.js server SDK)
Maintainers
Readme
@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.
targetingKeymaps to Featureflip'suser_id- Matched variation keys surface as
variant;ruleId/prerequisiteKeysurface inflagMetadata - OpenFeature
track()calls forward to Featureflip custom events, which are counted per event name per environment. The attached details are transmitted but not stored, and event counts are not surfaced in the app or API
Full documentation: https://featureflip.io/docs/integrations/openfeature/
License
Apache-2.0
