What is the Flags SDK?
mainThe Flags SDK (flags npm package) is a feature flags toolkit designed for Next.js and SvelteKit. It allows you to treat feature flags as callable functions, enabling server-side evaluation to prevent layout shifts and maintain page performance. It uses an adapter pattern to connect to various providers, including Vercel Flags (the first-party provider), Statsig, LaunchDarkly, and others.
import { flag } from 'flags/next';
export const exampleFlag = flag({
key: 'example-flag',
decide() { return false; },
});
const value = await exampleFlag();