Flags SDK is a free, open-source library for using feature flags in Next.js and SvelteKit.
The SDK sits between your application and the source of your flags, helping you follow best practices and keep your website fast.
Use any flag provider, or none at all. Flexible integrations for your projects.
Integrate with App Router, Pages Router, and Routing Middleware.
Ideal for A/B testing and controlled rollouts. Experiment with confidence.
With a simple declarative API to define and use your feature flags.
import { flag } from 'flags/next';export const exampleFlag = flag({ key: 'example-flag', decide() { return Math.random() > 0.5; },});import { exampleFlag } from "../flags";export default async function Page() { const example = await exampleFlag(); return <div>Flag {example ? "on" : "off"}</div>;}