SDKs
Installation
Install @flagfix packages from the public npm registry.
Last updated on

Pick one runtime package for your process. Do not import @flagfix/browser inside a Node service, and do not import @flagfix/node inside a browser bundle. @flagfix/sdk-core is pulled in transitively — you do not install it on purpose.
npm install @flagfix/browser
# or: pnpm add @flagfix/browser
# or: yarn add @flagfix/browserConfigure apiHost
Set apiHost to the FlagFix API your company uses. The hosted origin is https://api.flagfix.io.
createFlagFix({
clientKey: process.env.NEXT_PUBLIC_FLAGFIX_CLIENT_KEY!,
apiHost: process.env.NEXT_PUBLIC_FLAGFIX_API_HOST!,
});If apiHost is omitted, the SDK falls back to a placeholder host. Set it explicitly in every environment.
Verify
npm ls @flagfix/browser @flagfix/node @flagfix/reactNext: Initialization or Unit testing.
Was this page useful?