Skip to main content

Install the React SDK

The current package requires React 18 or newer and ships browser ESM, CommonJS, and TypeScript declarations.

Add a public client key

Create a pub_ key for the environment, then expose only that public key to the browser:
For Vite or another bundler, read its public environment variable yourself and pass the string through clientKey.
Never put an sdk_, admin_, or cli_ key in browser code or a public environment variable.

Mount the provider

In a Next.js App Router project, mount the provider from a client component.

Read flags

Use typed hooks, status, targeting context, and telemetry.

API reference

Review provider props, hooks, state, and cache behavior.