OpenFeature
OpenFeature is the CNCF open standard for feature
flagging. The @featureflip/openfeature-node provider connects the OpenFeature
Node.js server SDK to Featureflip, so you can use the vendor-neutral OpenFeature
API while Featureflip serves your flags.
Installation
Section titled “Installation”npm install @openfeature/server-sdk @featureflip/node @featureflip/openfeature-nodeBoth @openfeature/server-sdk and @featureflip/node are peer dependencies —
your application controls their versions and installs a single copy of each. A
single @featureflip/node copy is what lets the provider and any direct SDK
usage share one underlying client core (see below).
Quickstart
Section titled “Quickstart”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( 'new-checkout', false, { targetingKey: 'user-42', plan: 'pro' },);The provider owns the underlying Featureflip client. If you also need the raw
SDK (for track() calls outside OpenFeature, for example), call
FeatureflipClient.get() with the same SDK key — both handles share one
client core. You can also pass an existing FeatureflipClient instance to the
provider constructor instead of a config.
Context mapping
Section titled “Context mapping”| OpenFeature context | Featureflip context |
|---|---|
targetingKey | user_id (used for rollout bucketing) |
| Any other attribute | Passed through unchanged |
An explicit user_id (or userId) attribute takes precedence over
targetingKey. Without either, percentage rollouts bucketed by user serve the
control variation — see the SDK’s keyless-context behavior.
Evaluation reasons
Section titled “Evaluation reasons”| Featureflip outcome | OpenFeature reason | errorCode |
|---|---|---|
| Targeting rule matched | TARGETING_MATCH | — |
| Fallthrough serve | DEFAULT | — |
| Flag disabled in environment | DISABLED | — |
| Prerequisite not met | PREREQUISITE_FAILED | — |
| Flag not found | ERROR | FLAG_NOT_FOUND |
| Wrong value type requested | ERROR | TYPE_MISMATCH |
| Evaluation error | ERROR | GENERAL |
The matched variation key is exposed as variant, and rule/prerequisite
details are available in flagMetadata (ruleId, prerequisiteKey).
Tracking
Section titled “Tracking”OpenFeature tracking calls are forwarded to Featureflip custom events:
client.track('purchase', { targetingKey: 'user-42' }, { value: 9.99 });Limitations
Section titled “Limitations”- The provider does not yet emit
PROVIDER_CONFIGURATION_CHANGEDwhen flags change; evaluations always reflect the latest flag data (the SDK streams updates), but OpenFeature event handlers won’t fire on changes. getObjectValueaccepts objects and arrays only: a Json flag holding a bare primitive (string/number/boolean) resolves asTYPE_MISMATCHand returns the default.- Other Featureflip SDKs don’t have OpenFeature providers yet — Node.js is the first.