Flagward

Quickstart

Install an SDK and read your first flag.

Pick your framework, install its package, and read a flag. Every SDK shares the same core: flags are downloaded once and evaluated locally, so a flag check never blocks on the network.

An environment's API key is created in the dashboard under Environments → New Environment — see Creating your first flag for the full walkthrough.

npm install @flagward/react
import { FlagwardProvider, useFlag } from '@flagward/react';

function App() {
  return (
    <FlagwardProvider apiKey="your-environment-api-key">
      <Dashboard />
    </FlagwardProvider>
  );
}

function Dashboard() {
  const { value: showNewUI, isLoading } = useFlag('show-new-ui');

  if (isLoading) return <OldDashboard />;
  return showNewUI ? <NewDashboard /> : <OldDashboard />;
}

See the React SDK page for hooks, context, and Next.js notes.

Live updates

Call client.connect() (or use the adapter's provider, which does this for you) to open a Server-Sent Events stream and keep the local snapshot in step with the server — see SDKs.

Self-hosting

Point host at your own instance instead of the hosted default:

new FlagwardClient({ apiKey, host: 'https://flags.example.com' });

See Self-hosting to run Flagward with Docker Compose.

On this page