Try the Flags SDK
Set persistent flags for this pageKeep it dithered
Toggle between headline options for A/B testing
Full-width callout at the top
Using flags as code
The SDK sits between your application and the source of your flags, helping you follow best practices and keep your website fast.
Works with any provider
Use any flag provider, or none at all. Flexible integrations for your projects.
Effortless integration
Integrate with App Router, Pages Router, and Edge Middleware.
Release strategically
Ideal for A/B testing and controlled rollouts. Experiment with confidence.
flags.ts
import { flag } from 'flags/next'; export const exampleFlag = flag({ key: 'example-flag', decide() { return Math.random() > 0.5; },});
app/page.tsx
import { exampleFlag } from "../flags";
export default async function Page() { const example = await exampleFlag();
return <div>Flag {example ? "on" : "off"}</div>;}