Skip to main content

Get up and running with Flaggr in under 5 minutes

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 flg_your_token with your actual token
curl -s https://flaggr.dev/api/flags/evaluate \
  -H "Authorization: Bearer flg_your_token" \
  -H "Content-Type: application/json" \
  -d '{"flagKey":"checkout-v2","serviceId":"web-app"}' | jq

A 200 response with a flag value means your token is working.

4. Install the SDK

npm install @flaggr/client

5. Initialize and Use

import { initializeFlaggr, useBooleanFlag } from '@flaggr/client'
 
// Initialize once in your app
await initializeFlaggr({
  mode: 'remote',
  apiUrl: 'https://flaggr.dev',
  serviceId: 'your-service-id',
  apiKey: 'your-api-token',
})
 
// Use in your components
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. Toggle it on, and your component will instantly reflect the change.

Next Steps