Getting started
Install your first SDK
Add @flagfix/browser, @flagfix/node, or @flagfix/react from npm.
Last updated on

1. Choose a package
| App type | Package |
|---|---|
| Browser / SPA | @flagfix/browser |
| Node API / worker | @flagfix/node |
| React UI | @flagfix/react |
2. Install
npm install @flagfix/browser3. Create a client
Create a Client SDK key in the FlagFix dashboard, then:
import { createFlagFix } from "@flagfix/browser";
const client = createFlagFix({
clientKey: process.env.NEXT_PUBLIC_FLAGFIX_CLIENT_KEY!,
apiHost: "https://api.flagfix.io",
});
const started = await client.start();
if (!started.ready) {
console.error(started.reason);
}apiHost is the FlagFix API (see SDK overview). hasFeature before a successful refresh returns the fallback (false by default).
Next: Track your first event · Unit testing.
Was this page useful?