Everything you need to integrate FlagFeature into your app.
Get up and running with FlagFeature in under 5 minutes.
Evaluate feature flags from any language using our REST API.
GET /api/sdk/evaluateQuery Parameters
| Param | Type | Required | Description |
|---|---|---|---|
| projectId | string | required | Your project ID |
| environment | string | required | Environment name: development, staging, production |
| userId | string | optional | User ID for deterministic rollout hashing |
const res = await fetch(
'https://your-app.vercel.app/api/sdk/evaluate?projectId=PROJ_ID&environment=production&userId=user_123',
{ headers: { 'x-api-key': 'YOUR_API_KEY' } }
)
const { flags } = await res.json()
if (flags.new_feature) {
// show new feature
}Use this custom hook to evaluate flags in any React component.
import { useEffect, useState } from 'react'
export function useFlags(userId: string) {
const [flags, setFlags] = useState<Record<string, boolean>>({})
useEffect(() => {
fetch(
`/api/sdk/evaluate?projectId=PROJ_ID&environment=production&userId=${userId}`,
{ headers: { 'x-api-key': process.env.NEXT_PUBLIC_FLAG_API_KEY! } }
)
.then(r => r.json())
.then(data => setFlags(data.flags))
}, [userId])
return flags
}
// In your component:
const flags = useFlags(user.id)
if (flags.dark_mode) return <DarkTheme />Gradually roll out features to a percentage of your users.
Each project has three environments by default.
All endpoints require a Bearer JWT token unless noted.
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| POST | /api/auth/register | None | Create account |
| POST | /api/auth/login | None | Login, returns JWT |
| GET | /api/projects | JWT | List your projects |
| POST | /api/projects | JWT | Create a project |
| GET | /api/projects/:id | JWT | Project detail + flags + members |
| POST | /api/projects/:id/flags | JWT | Create a flag |
| PATCH | /api/projects/:id/flags/:id/toggle | JWT | Toggle flag or update rollout % |
| POST | /api/projects/:id/members | JWT | Invite a member |
| DELETE | /api/projects/:id/members | JWT | Remove a member |
| GET | /api/projects/:id/audit | JWT | Audit log (last 50) |
| GET | /api/analytics | JWT | Dashboard analytics |
| GET | /api/sdk/evaluate | API Key | Evaluate all flags for a project |