# JavaScript feature flags libraries

JavaScript feature flag libraries turn features on or off for each user at runtime without a new deploy. A flag evaluation combines the flag's targeting rules with attributes of the current user or request. These libraries run gradual rollouts, A/B tests, and kill switches in web apps and backend services.

## Popularity

| Library | Monthly downloads | Stars | Last release | License |
| --- | --- | --- | --- | --- |
| [OpenFeature server SDK](#openfeature-node-js) | 26.4M | 289 | Jul 2026 | Apache-2.0 |
| [@statsig/js-client](#statsig-js-client) | 16.7M | 18 | Nov 2026 | ISC |
| [LaunchDarkly Node.js](#launchdarkly-node-js) | 14.3M | 28 | Nov 2026 | Apache-2.0 |
| [Flags SDK](#flags) | 7.4M | 630 | Nov 2026 | MIT |
| [GrowthBook](#growthbook) | 6.0M | 8.6K | Nov 2026 | MIT |
| [Unleash Node.js](#unleash-client) | 3.9M | 226 | Sep 2026 | Apache-2.0 |
| [Split JavaScript SDK](#splitsoftware-splitio) | 2.3M | 49 | Oct 2026 | Apache-2.0 |
| [Optimizely JavaScript SDK](#optimizely-optimizely-sdk) | 1.8M | 82 | Nov 2026 | Apache-2.0 |

Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

[OpenFeature server SDK](#openfeature-node-js) has the most monthly downloads in this comparison, at 26.4M.

## Capabilities

| Library | Provider adapters | Browser evaluation |
| --- | --- | --- |
| [OpenFeature server SDK](#openfeature-node-js) | Yes | No |
| [@statsig/js-client](#statsig-js-client) | No | Yes |
| [LaunchDarkly Node.js](#launchdarkly-node-js) | No | No |
| [Flags SDK](#flags) | Yes | No |
| [GrowthBook](#growthbook) | No | Yes |
| [Unleash Node.js](#unleash-client) | No | Via plugin |
| [Split JavaScript SDK](#splitsoftware-splitio) | No | Yes |
| [Optimizely JavaScript SDK](#optimizely-optimizely-sdk) | No | Yes |

## Libraries

### OpenFeature server SDK

[GitHub](https://github.com/open-feature/js-sdk) · [npm](https://www.npmjs.com/package/@openfeature/server-sdk) · [Docs](https://openfeature.dev/docs/reference/technologies/server/javascript/)

Provides one flag evaluation API that works with many flag providers.

- Downloads / mo: 26.4M
- Stars: 289
- Last release: 1.23.0
- License: Apache-2.0
- Capabilities: [From the OpenFeature server SDK docs](https://openfeature.dev/docs/reference/technologies/server/javascript/)

**Strengths**

- **Changes providers behind one API.** Keep evaluation calls while replacing the feature flag backend.
- **Propagates request context.** Attach targeting attributes once for a transaction's downstream evaluations.

**Watch out for**

- **Needs a flag provider.** An unconfigured client returns fallback values until a provider is registered.
- **Provider events vary.** Check provider support before relying on configuration-change notifications.

```sh
npm install @openfeature/server-sdk@1.23.0
```

**vercel/flags** (630 stars)

[vercel/flags](https://github.com/vercel/flags) 

```typescript
export function createOpenFeatureAdapter(
  init: Client | (() => Promise<Client>),
): AdapterResponse<Client | (() => Promise<Client>)> {
  let client: Client | null = typeof init === 'function' ? null : init;

  let clientPromise: Promise<Client> | null = null;
  function initialize(): Client | Promise<Client> {
    if (client) return client;
    if (clientPromise) return clientPromise;

    const attempt = (
      typeof init === 'function' ? init() : Promise.resolve(init)
    ).then(
      (resolvedClient) => {
        client = resolvedClient;
        return resolvedClient;
      },
      (error: unknown) => {
        // Initialization failed. Unless the provider declared the failure
        // fatal, forget the rejected promise so the next evaluation retries
        // instead of replaying this error for the rest of the process' life.
        if (clientPromise === attempt && !isFatalError(error)) {
          clientPromise = null;
        }
        throw error;
      },
    );
    clientPromise = attempt;
    return attempt;
  }

  function booleanValue(
    options?: FlagEvaluationOptions,
  ): Adapter<boolean, EvaluationContext> {
    return {
      async decide({ key, entities, defaultValue }): Promise<boolean> {
        const client = await initialize();
        if (!client) return defaultValue as boolean;
        return client.getBooleanValue(
          key,
          defaultValue as boolean,
          entities,
          options,
        );
      },
    };
  }

  function stringValue(
    options?: FlagEvaluationOptions,
  ): Adapter<string, EvaluationContext> {
    return {
      async decide({ key, entities, defaultValue }): Promise<string> {
        const client = await initialize();
        if (!client) return defaultValue as string;
        return client.getStringValue(
          key,
          defaultValue as string,
          entities,
          options,
        );
      },
    };
  }

  function numberValue(
    options?: FlagEvaluationOptions,
  ): Adapter<number, EvaluationContext> {
    return {
      async decide({ key, entities, defaultValue }): Promise<number> {
        const client = await initialize();
        if (!client) return defaultValue as number;
        return client.getNumberValue(
          key,
          defaultValue as number,
          entities,
          options,
        );
      },
    };
  }

  function objectValue<ValueType>(
    options?: FlagEvaluationOptions,
  ): Adapter<ValueType, EvaluationContext> {
    return {
      async decide({ key, entities, defaultValue }): Promise<ValueType> {
        const client = await initialize();
        if (!client) return defaultValue as ValueType;
        return client.getObjectValue(
          key,
          defaultValue as JsonValue,
          entities,
          options,
        ) as ValueType;
      },
    };
  }

  return {
    booleanValue,
    stringValue,
    numberValue,
    objectValue,
    client:
      typeof init === 'function'
        ? async () => {
            const client = await initialize();
            if (!client)
              throw new Error(
                '@flags-sdk/openfeature: OpenFeature client failed to initialize',
              );
            return client;
          }
        : init,
  };
}

```

[packages/adapter-openfeature/src/index.ts](https://github.com/vercel/flags/blob/75fa30380195fe70e29bc1aadb3e23d64def68af/packages/adapter-openfeature/src/index.ts#L69) · [More projects using OpenFeature server SDK →](https://dashboard.exa.ai/playground/search?q=JavaScript%20TypeScript%20production%20application%20%40openfeature/server-sdk%20feature%20flag%20evaluation%20context%20lifecycle&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```typescript
import { OpenFeature, InMemoryProvider } from "@openfeature/server-sdk";
await OpenFeature.setProviderAndWait(new InMemoryProvider({
  "new-ui": { disabled: false, defaultVariant: "on", variants: { on: true, off: false } },
}));
const client = OpenFeature.getClient("example");
console.log(await client.getBooleanValue("new-ui", false));

```

From [five-minutes-to-feature-flags.md](https://openfeature.dev/docs/reference/technologies/server/javascript/)

### @statsig/js-client

[GitHub](https://github.com/statsig-io/js-client-monorepo) · [npm](https://www.npmjs.com/package/@statsig/js-client) · [Docs](https://docs.statsig.com/client/javascript-sdk)

Checks feature gates, dynamic configs, and experiments for one user in browser and React apps.

- Downloads / mo: 16.7M
- Stars: 18
- Last release: 3.33.8
- License: ISC
- Capabilities: [From the @statsig/js-client docs](https://docs.statsig.com/client/javascript-sdk)

**Strengths**

- **Client keys can ship in the app.** The client SDK key is designed to be embedded in browser code.

**Watch out for**

- **Values can come from the cache.** Await initializeAsync when a check needs the latest values.

```sh
npm install @statsig/js-client@3.33.8
```

**Quickstart**

```javascript
import { StatsigClient } from "@statsig/js-client";
const client = new StatsigClient("client-YOUR_CLIENT_KEY", { userID: "user-1" });
await client.initializeAsync();
console.log(client.checkGate("new-ui"));

```

From [Statsig docs](https://docs.statsig.com/client/javascript-sdk) · [Find projects using @statsig/js-client →](https://dashboard.exa.ai/playground/search?q=%40statsig/js-client%20GitHub%20projects)

### LaunchDarkly Node.js

[GitHub](https://github.com/launchdarkly/js-core) · [npm](https://www.npmjs.com/package/@launchdarkly/node-server-sdk) · [Docs](https://launchdarkly.com/docs/sdk/server-side/node-js)

Evaluates feature flags for multi-user Node.js server applications.

- Downloads / mo: 14.3M
- Stars: 28
- Last release: 9.16.7
- License: Apache-2.0
- Capabilities: [From the LaunchDarkly Node.js docs](https://launchdarkly.com/docs/sdk/server-side/node-js)

**Strengths**

- **Evaluates multi-user contexts.** Use one server client to evaluate flags for different users.
- **Returns evaluation details.** Use variationDetail to inspect the factors behind a flag result.

**Watch out for**

- **Requires a shared server client.** Create one client per project instead of one per request.
- **Shutdown needs an event flush.** Call flush before close to send pending analytics events.

```sh
npm install @launchdarkly/node-server-sdk@9.16.7
```

**Quickstart**

```typescript
import { init } from "@launchdarkly/node-server-sdk";
const client = init("YOUR_SERVER_SDK_KEY");
await client.waitForInitialization({ timeout: 5 });
console.log(await client.variation("new-ui", { kind: "user", key: "user-1" }, false));
client.close();

```

From [Node.js SDK docs](https://launchdarkly.com/docs/sdk/server-side/node-js) · [Find projects using LaunchDarkly Node.js →](https://dashboard.exa.ai/playground/search?q=JavaScript%20TypeScript%20production%20application%20%40launchdarkly/node-server-sdk%20feature%20flag%20evaluation%20context%20lifecycle&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

### Flags SDK

[GitHub](https://github.com/vercel/flags) · [npm](https://www.npmjs.com/package/flags) · [Docs](https://flags-sdk.dev/docs)

Declares feature flags as functions that Next.js pages, components, and middleware call.

- Downloads / mo: 7.4M
- Stars: 630
- Last release: 4.4.1
- License: MIT
- Capabilities: [From the Flags SDK docs](https://flags-sdk.dev/docs)

**Strengths**

- **Works with any flag provider.** Each flag's decide function can call a flag provider or custom logic.

```sh
npm install flags@4.4.1
```

**vercel/next-forge** (7.8K stars)

[vercel/next-forge](https://github.com/vercel/next-forge) 

```tsx
export const createFlag = (key: string) =>
  flag({
    key,
    defaultValue: false,
    async decide() {
      const { userId } = await auth();

      if (!userId) {
        return this.defaultValue as boolean;
      }

      if (!analytics) {
        return this.defaultValue as boolean;
      }

      const isEnabled = await analytics.isFeatureEnabled(key, userId);

      return isEnabled ?? (this.defaultValue as boolean);
    },
  });

```

[packages/feature-flags/lib/create-flag.ts](https://github.com/vercel/next-forge/blob/f189de79ceef7c1ef69f61f12e272f99b4cdb699/packages/feature-flags/lib/create-flag.ts#L5) · [More projects using Flags SDK →](https://dashboard.exa.ai/playground/search?q=flags%20GitHub%20projects)

**Quickstart**

```tsx
import { flag } from "flags/next";
const showNewUI = flag({ key: "new-ui", decide: () => true });
export default async function Page() {
  return <p>{String(await showNewUI())}</p>;
}

```

From [Flags SDK docs](https://flags-sdk.dev/docs)

### GrowthBook

[GitHub](https://github.com/growthbook/growthbook) · [npm](https://www.npmjs.com/package/@growthbook/growthbook) · [Docs](https://docs.growthbook.io/lib/js)

Evaluates feature flags and runs experiments in JavaScript.

- Downloads / mo: 6.0M
- Stars: 8.6K
- Last release: 2.2.0
- License: MIT
- Capabilities: [From the GrowthBook docs](https://docs.growthbook.io/lib/js)

**Strengths**

- **Shares one server client.** Pass separate user contexts to a shared GrowthBookClient.
- **Explains assigned feature values.** Use evalFeature to inspect why a user received a value.

**Watch out for**

- **Initialization failures need handling.** Unloaded features evaluate to null after failed downloads.
- **Targeting checks types strictly.** Match attribute types exactly; string IDs and numeric IDs differ.

```sh
npm install @growthbook/growthbook@2.2.0
```

**freeCodeCamp/freeCodeCamp** (459.2K stars)

[freeCodeCamp/freeCodeCamp](https://github.com/freeCodeCamp/freeCodeCamp) 

```typescript
const growthBook: FastifyPluginAsync<Options> = async (fastify, options) => {
  const gb = new GrowthBook(options);

  const hasRequiredConfig = Boolean(options.clientKey && options.apiHost);

  if (hasRequiredConfig) {
    const res = await gb.init({ timeout: 3000 });

    if (res.error) {
      fastify.log.error(res.error, 'Failed to initialize GrowthBook');
      fastify.Sentry?.captureException(res.error);
      fastify.Sentry?.metrics?.count('growthbook.init_failed', 1);
    }
  }

  fastify.decorate('gb', gb);

  fastify.addHook('onClose', () => {
    gb.destroy();
  });
};

```

[api/src/plugins/growth-book.ts](https://github.com/freeCodeCamp/freeCodeCamp/blob/012550e766525b2a8e4d413b70825a0aab862f91/api/src/plugins/growth-book.ts#L11) · [More projects using GrowthBook →](https://dashboard.exa.ai/playground/search?q=JavaScript%20TypeScript%20production%20application%20%40growthbook/growthbook%20feature%20flag%20evaluation%20context%20lifecycle&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```typescript
import { GrowthBook } from "@growthbook/growthbook";
const gb = new GrowthBook({ apiHost: "https://cdn.growthbook.io", clientKey: "sdk-YOUR_CLIENT_KEY", attributes: { id: "user-1" } });
await gb.init({ timeout: 3000 });
console.log(gb.isOn("new-ui"));

```

From [JavaScript SDK docs](https://docs.growthbook.io/lib/js)

### Unleash Node.js

[GitHub](https://github.com/Unleash/unleash-node-sdk) · [npm](https://www.npmjs.com/package/unleash-client) · [Docs](https://docs.getunleash.io/reference/sdks/node)

Evaluates feature flags locally in Node.js against configurations fetched from Unleash or Unleash Edge.

- Downloads / mo: 3.9M
- Stars: 226
- Last release: 6.12.2
- License: Apache-2.0
- Capabilities: [From the Unleash Node.js docs](https://docs.getunleash.io/reference/sdks/node)

**Strengths**

- **Open source or enterprise backend.** The same SDK connects to Unleash Open Source or Unleash Enterprise.

**Watch out for**

- **Flags read false until synced.** Bootstrap a configuration or wait for synchronization before relying on flag values.

```sh
npm install unleash-client@6.12.2
```

**Quickstart**

```javascript
import { startUnleash } from "unleash-client";
const client = await startUnleash({ url: "https://YOUR_UNLEASH_HOST/api/", appName: "example", customHeaders: { Authorization: "YOUR_SERVER_API_TOKEN" } });
console.log(client.isEnabled("new-ui", { userId: "user-1" }));
client.destroy();

```

From [Node SDK docs](https://docs.getunleash.io/reference/sdks/node) · [Find projects using Unleash Node.js →](https://dashboard.exa.ai/playground/search?q=unleash-client%20GitHub%20projects)

### Split JavaScript SDK

[GitHub](https://github.com/splitio/javascript-client) · [npm](https://www.npmjs.com/package/@splitsoftware/splitio) · [Docs](https://raw.githubusercontent.com/splitio/javascript-client/master/README.md)

Evaluates Split feature flags in Node.js and in web browsers from one isomorphic library.

- Downloads / mo: 2.3M
- Stars: 49
- Last release: 11.12.1
- License: Apache-2.0
- Capabilities: [From the Split JavaScript SDK docs](https://raw.githubusercontent.com/splitio/javascript-client/master/README.md)

**Watch out for**

- **Old browsers need polyfills.** Add Promise, Map, and Set polyfills for browsers without native support.

```sh
npm install @splitsoftware/splitio@11.12.1
```

**configu/configu** (1.7K stars)

[configu/configu](https://github.com/configu/configu) 

```javascript
constructor(configuration: SplitConfigStoreConfiguration) {
  const { authKey, context } = configuration;
  const splitClient = SplitFactory({ core: { authorizationKey: authKey } }).client();
  const provider = new OpenFeatureSplitProvider({ splitClient }) as Provider;

  super({
    provider,
    context,
  });

  this.splitClient = splitClient;
}

```

[packages/stores/split/src/index.ts](https://github.com/configu/configu/blob/89c0cabd595caa1849551416a6a703efeb7c8a20/packages/stores/split/src/index.ts#L17) · [More projects using Split JavaScript SDK →](https://dashboard.exa.ai/playground/search?q=%40splitsoftware/splitio%20GitHub%20projects)

**Quickstart**

```javascript
import { SplitFactory } from "@splitsoftware/splitio";
const client = SplitFactory({ core: { authorizationKey: "YOUR_SERVER_SDK_KEY" } }).client();
client.on(client.Event.SDK_READY, () => {
  console.log(client.getTreatment("user-1", "new-ui"));
});

```

From [README.md](https://raw.githubusercontent.com/splitio/javascript-client/master/README.md)

### Optimizely JavaScript SDK

[GitHub](https://github.com/optimizely/javascript-sdk) · [npm](https://www.npmjs.com/package/@optimizely/optimizely-sdk) · [Docs](https://raw.githubusercontent.com/optimizely/javascript-sdk/master/README.md)

Runs feature flags and A/B tests from Optimizely Feature Experimentation in JavaScript and TypeScript.

- Downloads / mo: 1.8M
- Stars: 82
- Last release: 6.7.0
- License: Apache-2.0
- Capabilities: [From the Optimizely JavaScript SDK docs](https://raw.githubusercontent.com/optimizely/javascript-sdk/master/README.md)

**Strengths**

- **Modular architecture.** Each part of the client, such as event processing, is configured as a separate module.

**Watch out for**

- **Upgrades change the API.** Follow the migration guide when moving from an earlier major version.

```sh
npm install @optimizely/optimizely-sdk@6.7.0
```

**Quickstart**

```javascript
import { createInstance, createPollingProjectConfigManager, createBatchEventProcessor, createOdpManager } from "@optimizely/optimizely-sdk";
const client = createInstance({
  projectConfigManager: createPollingProjectConfigManager({ sdkKey: "YOUR_SDK_KEY" }),
  eventProcessor: createBatchEventProcessor(),
  odpManager: createOdpManager(),
});
try {
  await client.onReady();
  const user = client.createUserContext("user-1");
  console.log(user.decide("new-ui"));
} finally {
  await client.close();
}

```

From [README.md](https://github.com/optimizely/javascript-sdk/blob/v6.7.0/README.md) · [Find projects using Optimizely JavaScript SDK →](https://dashboard.exa.ai/playground/search?q=%40optimizely/optimizely-sdk%20GitHub%20projects)

## FAQ

### What is GrowthBook?

[GrowthBook](#growthbook) is an open source platform for feature flags, experimentation, and product analytics. Its JavaScript SDK evaluates flags and runs experiments in the browser and in Node.js.

### What is OpenFeature?

[OpenFeature](#openfeature-node-js) defines one vendor-neutral API for evaluating feature flags. A provider connects that API to a commercial, open source, or in-house flag backend.

### How does Unleash evaluate feature flags in Node.js?

[Unleash Node.js](#unleash-client) fetches flag configurations from Unleash or Unleash Edge and evaluates them locally against an Unleash context. Until the SDK synchronizes, every flag evaluates to false unless a bootstrapped configuration exists.

### LaunchDarkly vs Statsig: which should I use?

[LaunchDarkly Node.js](#launchdarkly-node-js) evaluates flags for many users inside a Node.js server application. The [Statsig JavaScript client](#statsig-js-client) runs in the browser for one user, with gates, dynamic configs, and experiments.

### How does GrowthBook avoid sharing one user's attributes with another request?

A shared GrowthBookClient takes a separate userContext during flag evaluation. Request-scoped instances provide another way to carry the current request's context.

### Does a completed GrowthBook init promise guarantee flags loaded?

Network failures can leave default feature values without throwing. The initialization result reports success, source, and error; inspect them before relying on downloaded flags.

## How this page was built

Data checked Nov 20, 2026.

Reproduce it with the Exa API:

```json
{
  "endpoint": "/search",
  "body": {
    "query": "Best JavaScript feature flag libraries server browser Node SDK code examples",
    "numResults": 5
  }
}
```

Docs: https://exa.ai/docs/reference/search
