vercel-flags

Implement feature flags, gradual rollouts, and A/B testing with the Vercel Flags SDK.

Updated Jul 31, 2026
One-click install
npx skills add https://github.com/AarnavBaddam/skills --skill vercel-flags-aarnavbaddam
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-flags
Source: https://github.com/AarnavBaddam/skills/tree/main/vercel-flags
Command: npx skills add https://github.com/AarnavBaddam/skills --skill vercel-flags-aarnavbaddam

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Feature flag APIs change frequently and outdated training data leads to broken implementations. This Skill provides current guidance for the Vercel Flags platform and the flags SDK (v4+), covering flag definition, provider adapters, Flags Explorer setup, and precompute patterns so you avoid deprecated APIs like @vercel/flags v3. ## Core Features & Use Cases - Flag Definition & Evaluation: Define boolean and multi-variant flags with flag() from flags/next or flags/sveltekit, with server-only evaluation and no call-site arguments. - Provider Adapters: Connect Vercel Flags via @flags-sdk/vercel or third-party providers (LaunchDarkly, Statsig, GrowthBook, PostHog) through @flags-sdk/* adapters, including an OpenFeature bridge. - Flags Explorer & Precompute: Set up the .well-known/vercel/flags discovery endpoint for toolbar overrides, and use precompute patterns to serve static personalized page variants via middleware. - Use Case: You are rolling out a redesigned checkout to 10% of users. Define a show-new-checkout flag with the Vercel adapter, configure percentage targeting in the Vercel dashboard, and let developers override it locally through Flags Explorer. ## Quick Start Ask the assistant to define a boolean feature flag using the flags/next SDK with the Vercel adapter and wire up the Flags Explorer discovery endpoint in a Next.js App Router project.

Frequently Asked Questions about vercel-flags

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I define a feature flag with the Vercel Flags SDK?

Import flag from flags/next and declare it with a key, optional options array, and a decide function returning the default value. Call the flag as an async function in Server Components, Route Handlers, or Server Actions to read its value.

How do I migrate from @vercel/flags v3 to the flags package v4?

Replace @vercel/flags with the flags package in imports and package.json. Replace encrypt/decrypt with encryptFlagValues and decryptFlagValues, use a 32-byte base64 FLAGS_SECRET, and note that flags without a decide function now throw at declaration time.

Does Vercel Flags work with third-party providers like LaunchDarkly or Statsig?

Yes, adapters published under the @flags-sdk npm scope connect providers including LaunchDarkly, Statsig, GrowthBook, PostHog, and Hypertune. An OpenFeature adapter also bridges most Node.js OpenFeature providers into the Flags SDK.

How do I set up Flags Explorer in a Next.js App Router project?

Create app/.well-known/vercel/flags/route.ts exporting a GET handler built with createFlagsDiscoveryEndpoint and getProviderData from flags/next. This lets the Vercel Toolbar discover flags and override them in the browser session.

When should I use Edge Config instead of Vercel Flags?

Use Edge Config directly for ultra-low-latency non-flag configuration reads or simple static config without targeting. Use Vercel Flags for gradual rollouts, A/B testing, segments, and anything needing the dashboard or Flags Explorer.