FEATUREFLOW V2AI-native · MCP-enabled ·30% off your first year:NEXT30claim →

server SDK

Node.js feature flags

featureflow-node-sdk downloads your environment's rules and evaluates them in memory. An evaluation is not a network call. Use a server key (sdk-srv-env-…). It is a secret. Create the client once and share it.

Node.js docsGitHubfeatureflow-node-sdk

Set it up with your coding agent

Paste this into Claude Code, Cursor or any coding agent. It installs the Node.js SDK, creates the client and evaluates your first flag.

Set up Featureflow with the Node.js SDK in this project. Run `npx skills add featureflow/featureflow-skills --skill featureflow-setup -y` first, then follow the skill. Keep SDK keys in env vars.

Or set it up by hand

Install

npm
npm install --save featureflow-node-sdk

Initialise

Client
import Featureflow from 'featureflow-node-sdk';

const featureflow = new Featureflow.Client({
  apiKey: process.env.FEATUREFLOW_SERVER_KEY,
});

featureflow.ready(() => {
  // rules are loaded
});

Evaluate a flag

evaluate
const user = new Featureflow.UserBuilder('user-123')
  .withAttribute('tier', 'gold')
  .build();

if (featureflow.evaluate('new-checkout', user).isOn()) {
  // new path
}

Kill switch

Leave the flag off and branch on evaluate('new-checkout', user).isOn(). Register a failover with withFeatures so an unreachable host still serves a variant you chose. new Featureflow.Feature('new-checkout', 'off').build() defaults that flag to off. A feature registered with no variant also defaults to off.

The operational side is the kill switch. Turning the flag off does not require a redeploy.

Gradual rollout

The percentage lives on the flag. Keep passing the same user id. A string id is enough when you have no attributes: evaluate('my-feature', 'user-123').isOn(). Do not create a client per request.

See progressive rollout for the dashboard control. Release pipelines and approval workflows, if the change itself needs a review, are on the Business plan at $399 a month. That price is on the pricing page.

Targeting

UserBuilder(id).withAttribute(key, value) and withAttributes(key, array) attach what the dashboard rules match. You can also set FEATUREFLOW_SERVER_KEY and construct new Featureflow.Client() with no apiKey. jsonValue() needs featureflow-node-sdk 0.7.0 or later and returns undefined when the variant has no JSON config.

Frequently asked questions

Which package is the Node.js feature flags SDK?

featureflow-node-sdk. It exposes Featureflow.Client, Featureflow.UserBuilder and Featureflow.Feature, and it ships TypeScript types.

Where does the API key go?

In the server process only. Set FEATUREFLOW_SERVER_KEY to a sdk-srv-env- key, or pass apiKey. Browser code uses featureflow-client instead.

Do I create a client per request?

No. The docs say to instantiate once and share it. Wait for ready(), or pass a callback to the constructor, before you serve traffic that depends on flags.

Other SDKs

Create the flag, then evaluate it

Every SDK is on the free plan. No credit card.