Flags as Code in Next.js
Jul 26, 2024

Summary
Introduces the new Flags SDK for Next.js and SvelteKit, enabling server-side evaluation of feature flags. Details guiding principles: flags as functions, server-side evaluation only, and flags accepting no arguments on the call side. Explains primitive flags and progressions with tradeoffs: hardcoded flags (slow to change, affects everyone) vs. overriding from Vercel Toolbar (session-specific overrides for testing). Discusses using environment variables and Edge Config as flag sources, and mentions OpenFeature integration. Highlights the benefit of precomputing feature flags for static page variants.
More from the Vercel Flags trail
- Vercel Flags: Platform-native feature flags
- Introducing the Flags Explorer, first-party integrations, and updates to the Flags SDK
- Introducing deeper integrations for feature flags in Vercel
- Introducing feature flag management from the Vercel Toolbar
- Vercel Edge Config + LaunchDarkly: Low latency, global feature flags to your favorite frontend framework