FlagFix
SDKs

SDK overview

Choose the right @flagfix package and point it at the FlagFix API.

Last updated on

FlagFix

FlagFix ships client libraries. They talk to the FlagFix API, not to the dashboard session.

Your app (browser / Node / React)
        │  X-FlagFix-Sdk-Key
        ▼
   https://api.flagfix.io
        ├── /api/v1/runtime/*   flags
        └── /api/v1/ingest/*    events

Which package should I install?

PackageUse whenKey type
@flagfix/browserSPA, vanilla JS, or any browser bundleClient SDK key
@flagfix/nodeAPIs, workers, SSR helpersServer SDK key
@flagfix/reactReact 18+ UI (provider + hooks)Client key (wraps browser)

@flagfix/react depends on @flagfix/browser. Do not import @flagfix/sdk-core in your application. It is installed for you.

Quick start

  1. Install the package for your runtime
  2. Create a key in the FlagFix dashboard (Client or Server)
  3. Set apiHost to https://api.flagfix.io, or to the API host your company uses
  4. Call start(), then identify / hasFeature / track
import { createFlagFix } from "@flagfix/browser";

const client = createFlagFix({
  clientKey: process.env.NEXT_PUBLIC_FLAGFIX_CLIENT_KEY!,
  apiHost: "https://api.flagfix.io",
});

await client.start();
client.identify("user_123", { plan: "pro" });
if (client.hasFeature("new_checkout")) {
  client.trackExposure("new_checkout");
}

Next

SDK package version 0.1.0 and runtime contract 1.0.0 are different numbers. Do not treat them as a single “platform version”.

Was this page useful?

On this page