Skip to content
Dashboard

Shipping safer and smarter: Integrating feature flags deeper in the Vercel workflow

Introducing a platform-wide understanding of feature flags and an experimental Next.js design pattern.

Link to headingOverride your flags from the Vercel Toolbar

Using feature flags to toggle Notion's new homepage design
Working with our feature flags in Vercel boosts our ability to quickly and safely iterate on experiments and features in development. The best part? It just works. It feels so magical during our development process.
Tanner Godarzi Frontend Engineer at Notion

Link to headingIntegration with the DX Platform

Flags are directly integrated with Vercel Web Analytics and Runtime Logs.Flags are directly integrated with Vercel Web Analytics and Runtime Logs.
Flags are directly integrated with Vercel Web Analytics and Runtime Logs.
import { reportValue } from "@vercel/flags"
reportValue("summer-sale", true)

Integrating with Runtime Logs.

import { FlagValues } from '@vercel/flags/react';
<FlagValues values={{ "summer-sale": true }} />

Integrating with Web Analytics.

Link to headingFeature flags as code

import { unstable_flag as flag } from "@vercel/flags/next"
export const showSummerSale = flag({​​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍​‌‍‌‍‍‌‌​‌‍‌‌‌‍‍‌‌​‌‍‌‍‌‌‌‌‍​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍​‍‌‍​‌‌​​‌‍‍‌​‍‌‍​‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‌‍‌‌​‌​‌‌‌‌‌‍​‌​‌‍‌​​‌​‌‌‍‌‍‍​​‌​​​‌​‌​‌‍‌‍‍​​​​​​‍‌‍‍‍‌‍‍‌‌‍‌‌‌‌‍‌​‌​‌‌‍‍​​​‍‌‍‌‌​​‌‌‍‌‌​‍​‍‌‌
key: 'summer-sale',​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍​‌‍‌‍‍‌‌​‌‍‌‌‌‍‍‌‌​‌‍‌‍‌‌‌‌‍​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍​‍‌‍​‌‌​​‌‍‍‌​‍‌‍​‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‌‍‌‌​‌​‌‌‌‌‌‍​‌​‌‍‌​​‌​‌‌‍‌‍‍​​‌​​​‌​‌​‌‍‌‍‍​​​​​​‍‌‍‍‍‌‍‍‌‌‍‌‌‌‌‍‌​‌​‌‌‍‍​​​‍‌‍‌‌​​‌‌‍‌‌​‍​‍‌‌
async decide() {​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍​‌‍‌‍‍‌‌​‌‍‌‌‌‍‍‌‌​‌‍‌‍‌‌‌‌‍​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍​‍‌‍​‌‌​​‌‍‍‌​‍‌‍​‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‌‍‌‌​‌​‌‌‌‌‌‍​‌​‌‍‌​​‌​‌‌‍‌‍‍​​‌​​​‌​‌​‌‍‌‍‍​​​​​​‍‌‍‍‍‌‍‍‌‌‍‌‌‌‌‍‌​‌​‌‌‍‍​​​‍‌‍‌‌​​‌‌‍‌‌​‍​‍‌‌
return false;​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍​‌‍‌‍‍‌‌​‌‍‌‌‌‍‍‌‌​‌‍‌‍‌‌‌‌‍​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍​‍‌‍​‌‌​​‌‍‍‌​‍‌‍​‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‌‍‌‌​‌​‌‌‌‌‌‍​‌​‌‍‌​​‌​‌‌‍‌‍‍​​‌​​​‌​‌​‌‍‌‍‍​​​​​​‍‌‍‍‍‌‍‍‌‌‍‌‌‌‌‍‌​‌​‌‌‍‍​​​‍‌‍‌‌​​‌‌‍‌‌​‍​‍‌‌
},​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍​‌‍‌‍‍‌‌​‌‍‌‌‌‍‍‌‌​‌‍‌‍‌‌‌‌‍​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍​‍‌‍​‌‌​​‌‍‍‌​‍‌‍​‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‌‍‌‌​‌​‌‌‌‌‌‍​‌​‌‍‌​​‌​‌‌‍‌‍‍​​‌​​​‌​‌​‌‍‌‍‍​​​​​​‍‌‍‍‍‌‍‍‌‌‍‌‌‌‌‍‌​‌​‌‌‍‍​​​‍‌‍‌‌​​‌‌‍‌‌​‍​‍‌‌
});‍​​​​

Declaring your own feature flag.

import { showSummerSale } from "@/flags"
export async function Banner() {
const summerSale = await showSummerSale()
return summerSale ? <SummerSaleBanner /> : <RegularBanner />;
}

Using a feature flag.

Check out the SDK

Start experimenting server-side, with better performance and less jank.

View the docs

Start interacting with your application’s feature flags.

Unlock the new workflow today: Use the Vercel Toolbar to read and set feature flag overrides for your application.

Get started