---
title: How to use Vercel Flags across projects
description: Evaluate flags across projects using a source project SDK Key in the consumer project via a custom adapter
url: /kb/guide/how-to-use-vercel-flags-across-projects
canonical_url: "https://vercel.com/kb/guide/how-to-use-vercel-flags-across-projects"
last_updated: 2026-06-17
authors: Dominik Ferber
related:
  - /docs/flags/vercel-flags/sdks/flags-sdk
  - /docs/flags/vercel-flags/sdks
  - /docs/flags/vercel-flags/sdks/core
  - /docs/flags/vercel-flags/dashboard/sdk-keys
  - /docs/flags/vercel-flags/dashboard/feature-flag
  - /docs/deployments/environments
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---

By default, a Vercel project evaluates only the Vercel Flags owned by that project. To evaluate flags from another project, add an SDK Key from the source project to the consumer project and connect your SDK client to that key.

Cross-project flag evaluation is useful for microfrontend architectures, shared services, or feature flags that control behavior across multiple Vercel projects.

## Prerequisites

Before you start, make sure you have:

- Two or more Vercel projects
  
- Feature flags created in the source project
  
- The [Flags SDK](https://vercel.com/docs/flags/vercel-flags/sdks/flags-sdk), [OpenFeature SDK](https://vercel.com/docs/flags/vercel-flags/sdks), or [`@vercel/flags-core`](https://vercel.com/docs/flags/vercel-flags/sdks/core) installed in the consumer project
  

## How cross-project evaluation works

Cross-project flag evaluation uses a source project and a consumer project.

- **Source project**: The Vercel project where the feature flags are defined and managed. For example, Project A.
  
- **Consumer project**: The Vercel project that needs to evaluate flags from the source project. For example, Project B.
  
- **SDK Key**: A secret, environment-scoped key that grants read-only access to one project's flag configuration.
  

SDK Keys are scoped to a single project and environment. A Production SDK Key reads the Production flag configuration, a Preview SDK Key reads the Preview flag configuration, and a Development SDK Key reads the Development flag configuration.

> SDK Keys are secrets. Each SDK Key grants read-only access to the full flag configuration for its environment, including data used in targeting rules, such as email addresses. Never expose SDK Keys in client-side code or commit them to version control.

## Set up cross-project flag evaluation

### Create SDK Keys in the source project

1. Navigate to the source project (Project A) in the Vercel Dashboard.
   
2. Open **Flags** in the sidebar.
   
3. Select **SDK Keys**.
   
4. Click **Create SDK Key**.
   
5. Create one SDK Key for each environment the consumer project needs to evaluate.
   
   For example:
   
   - Create a Development SDK Key for local or development usage.
     
   - Create a Preview SDK Key for preview deployments.
     
   - Create a Production SDK Key for production deployments.
     
6. Label each key with the consumer project's name and environment.
   
   For example, use labels such as `Project B - Production` or `Project B - Preview`. Labels help you identify which consumers depend on each key.
   

### Add the SDK Keys to the consumer project

1. Navigate to the consumer project (Project B) in the Vercel Dashboard.
   
2. Go to **Settings** > **Environment Variables**.
   
3. Create an environment variable for the source project's SDK Key.
   
   For example, create `PROJECT_A_FLAGS_KEY`.
   
4. Set the value for each environment to the matching SDK Key from the source project.
   
   For example:
   
   - Set the Development value to Project A's Development SDK Key.
     
   - Set the Preview value to Project A's Preview SDK Key.
     
   - Set the Production value to Project A's Production SDK Key.
     
5. Redeploy the consumer project if you added or changed the environment variable for an existing deployment.
   

## Connect the consumer project in code

In the consumer project, create an adapter or client that reads from the new environment variable instead of the default `FLAGS` variable.

The default `FLAGS` variable points to the current project. A custom SDK Key points to the source project.

### Using the Flags SDK

Use `createVercelAdapter` from `@flags-sdk/vercel` to connect a flag to the source project's SDK Key.

`import { flag } from 'flags/next'; import { createVercelAdapter } from '@flags-sdk/vercel'; const projectAAdapter = createVercelAdapter( process.env.PROJECT_A_FLAGS_KEY, ); export const sharedFlag = flag({ key: 'shared-flag', adapter: projectAAdapter(), });`

In this example, `sharedFlag` is defined in Project A and evaluated from Project B.

### Using OpenFeature

Pass the source project's SDK Key to `VercelProvider`.

`import { OpenFeature } from '@openfeature/server-sdk'; import { VercelProvider } from '@vercel/flags-core/openfeature'; const projectAProvider = new VercelProvider( process.env.PROJECT_A_FLAGS_KEY, ); await OpenFeature.setProviderAndWait(projectAProvider); const client = OpenFeature.getClient(); const value = await client.getBooleanValue('shared-flag', false);`

### Using the core library

Pass the source project's SDK Key to `createClient`.

`import { createClient } from '@vercel/flags-core'; const projectAClient = createClient(process.env.PROJECT_A_FLAGS_KEY); const value = await projectAClient.evaluate('shared-flag');`

## Use project-owned and cross-project flags together

A consumer project can evaluate its own flags and source-project flags in the same codebase.

Use `vercelAdapter()` for flags owned by the current project. Use `createVercelAdapter()` with the source project's SDK Key for cross-project flags.

`import { flag } from 'flags/next'; import { createVercelAdapter, vercelAdapter } from '@flags-sdk/vercel'; export const ownFlag = flag({ key: 'own-feature', adapter: vercelAdapter(), }); const projectAAdapter = createVercelAdapter( process.env.PROJECT_A_FLAGS_KEY, ); export const sharedFlag = flag({ key: 'shared-feature', adapter: projectAAdapter(), });`

In this example, `ownFlag` reads from the current project's `FLAGS` environment variable. `sharedFlag` reads from `PROJECT_A_FLAGS_KEY`, which points to Project A.

## Security considerations

Treat cross-project SDK Keys the same way you treat other production secrets.

- Store SDK Keys as environment variables.
  
- Never expose SDK Keys in client-side code.
  
- Never commit SDK Keys to version control.
  
- Create separate SDK Keys for each consumer project.
  
- Label SDK Keys with the consumer project and environment.
  
- Rotate a key if it is exposed or no longer needed.
  

If a key is exposed, follow the [SDK Key rotation process](https://vercel.com/docs/flags/vercel-flags/dashboard/sdk-keys#how-to-rotate-sdk-keys):

1. Create a new key
   
2. Update the consumer project's environment variable
   
3. Redeploy the consumer project
   
4. Delete the old key.
   

## Next Steps

- [SDK Keys](https://vercel.com/docs/flags/vercel-flags/dashboard/sdk-keys)
  
- [Using the Flags SDK with Vercel Flags](https://vercel.com/docs/flags/vercel-flags/sdks/flags-sdk)
  
- [Using the Core Library](https://vercel.com/docs/flags/vercel-flags/sdks/core)
  
- [SDKs](https://vercel.com/docs/flags/vercel-flags/sdks)
  
- [Feature Flag Configuration](https://vercel.com/docs/flags/vercel-flags/dashboard/feature-flag)
  
- [Deployment Environments](https://vercel.com/docs/deployments/environments)