Get up and running with Flaggr in under 5 minutes
Last updated November 21, 2026
Quick Start
Get up and running with Flaggr in under 5 minutes.
1. Create a Project
Sign in to the Flaggr Dashboard and create a new project. Each project can contain multiple services, and each service has its own set of feature flags.
2. Create a Service
Within your project, create a service that represents the application where you'll use feature flags (e.g., "web-app", "api-server").
3. Generate an API Token
Navigate to your project settings and generate an API token with read scope. You'll use this token to authenticate SDK requests.
Once you have your token, verify it works with a quick curl test:
# Replace fgr_your_token with your actual token
curl -s https://api.flaggr.dev/api/flags/evaluate \
-H "Authorization: Bearer fgr_your_token" \
-H "Content-Type: application/json" \
-d '{"flagKey":"checkout-v2","serviceId":"web-app"}' | jqA 200 response means your token works. Until you create checkout-v2, its body has "reason": "FLAG_NOT_FOUND" and "value": null. A 401 means the token was refused.
4. Install the SDK
<!-- One tag: it configures itself from its data-* attributes -->
<script src="https://cdn.flaggr.dev/sdk.js"
data-service-id="your-service-id"
data-api-key="fgr_your_token"
data-api-url="https://api.flaggr.dev"
data-environment="production"
defer></script>
<script type="module">
const enabled = await flaggr.flag('checkout-v2', false)
</script>https://cdn.flaggr.dev/sdk.js serves the @flaggr/sdk browser bundle from npm. Keep data-api-url while it serves 0.4.0: without it, 0.4.0 sends evaluations to the relative URL undefined/api/flags/evaluate, next to the page, and returns your defaults. See Script tag for the other attributes, jsDelivr and pinned versions.
5. Initialize and Use
TypeScript and React use @flaggr/sdk; set environment, since the data plane evaluates in production without one. In the Next.js App Router, render FlaggrProvider from a 'use client' file (see React Hooks). Python and Go use Flaggr's SDKs, which evaluate in production unless you pass another environment; the examples read the token from the FLAGGR_TOKEN environment variable. The Python and Go SDK pages also show the OpenFeature OFREP providers, which evaluate in development unless you send X-Environment.
import { FlaggrProvider, useBooleanFlag } from '@flaggr/sdk/react'
function App() {
return (
<FlaggrProvider apiKey="fgr_your_token" serviceId="your-service-id" environment="production">
<MyComponent />
</FlaggrProvider>
)
}
function MyComponent() {
const isEnabled = useBooleanFlag('my-feature', false)
if (isEnabled) {
return <NewFeature />
}
return <ClassicFeature />
}6. Create Your First Flag
In the dashboard, create a boolean flag with key my-feature in the production environment, the one every example above evaluates in. Toggle it on, then reload the page to see the new feature. With updateMode: 'stream' (config={{ serviceId: 'your-service-id', updateMode: 'stream' }} on FlaggrProvider), the component updates without a reload.
Next Steps
- Client SDK Reference — Full SDK API documentation
- API Tokens — Token scopes and management
- Protocols — REST, gRPC, Connect-RPC, and OFREP
- Environments — Multi-environment configuration