Skip to main content
Post

Evaluate Vercel Flags from another project without sharing SDK keys.

Vercel added Project Connections for Vercel Flags, so one project can evaluate flags defined in another project on the same team without a copied SDK key.

Before this, sharing flags between projects meant putting a server SDK key in an environment variable and managing it by hand. Now you connect the projects from the source project's Connections page under Flags, or with vercel flags connections in the CLI. The consumer project authenticates with its deployment's identity (an OIDC token). For local development, vercel env pull fetches that token.

In the consumer app, you create an adapter with the source project's ID using createVercelAdapter and attach it to a flag. A flag using that adapter reads from the source project. A flag using vercelAdapter() still reads from the consumer project's own flags. The consumer's deployment picks the environment, so production deployments evaluate production flags.

Connections are read-only and cover all flags and environments in the source project. You can't limit one to specific flags. Read access includes flag configuration and targeting-rule data, so connect only projects that should see it. Removing a connection revokes access without a redeploy, so set a defaultValue on each flag for when evaluation fails.

It's available on all plans. You need @flags-sdk/vercel 1.6.0 or later (or @vercel/flags-core 1.11.0 or later), and Vercel CLI 63.0.0 or later to manage connections from the CLI.

Loading replies…
Loading replies