npm / flags
flags
What changed in flags 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
2 breaking1 deprecations2 new APIs and options3 performance5 behavior and defaults5 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initflags 418 changes
Breaking changes 2
The Edge Config adapter package is renamed to @flags-sdk/global-config.
Declaring a feature flag without a decide function, or with an adapter missing one, now throws an error at declaration time.
Deprecations 1
Previous Edge Config names remain available as deprecated aliases.
New APIs and options 2
Adds an adapter hook for observing values set by the Flags SDK override cookie. It is not supported for general use unless Vercel has explicitly enabled it.
Adapters can opt into bulk evaluation by implementing bulkDecide and setting a stable adapterId; flags with matching adapterId and identify source are evaluated together.
Performance 3
evaluate() and precompute() defer bulk evaluation to capable adapters, falling back to per-flag evaluation otherwise; shared request reads are reused.
Reduces microtask queue overhead by replacing the async IIFE around decide() with a direct call and Promise.resolve().
Caches the resolved next/headers module locally so only the first call awaits the dynamic import, reducing overhead in flag evaluation.
Behavior and default changes 5
Global Config environment variables replace the Edge Config names; previous environment variables remain honored as fallbacks.
The flags discovery endpoint returns cache-control: no-store.
Accepts a NextRequest or Web Request directly outside App Router, including in routing middleware, instead of requiring a Pages Router IncomingMessage or manually flattened headers.
Accepts a NextRequest or Web Request directly outside App Router, including in routing middleware, instead of requiring a Pages Router IncomingMessage or manually flattened headers.
Tracing emits an evaluate span with flagCount and one batch span per bulk-evaluated adapter group instead of individual per-flag run spans.
Fixes and other changes 5
Removed @sveltejs/kit from peer dependencies to prevent npm from auto-installing it and causing Vite peer dependency conflicts in non-SvelteKit projects.
Next.js control-flow errors are re-thrown without marking flag evaluation spans as errored; genuine evaluation failures still mark spans as errored.
Recognizes hanging promise rejection as an internal Next.js error.
Guards internal flag hooks when Vercel does not expose the expected runtime helpers during evaluation.
When an app goes from precomputing flags to precomputing none, the SDK serializes __no_flags__ so the app still rewrites and prerenders the page.