惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Docker
IT之家
IT之家
Microsoft Security Blog
Microsoft Security Blog
博客园 - 司徒正美
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
D
DataBreaches.Net
B
Blog RSS Feed
博客园_首页
The GitHub Blog
The GitHub Blog
I
InfoQ
L
LangChain Blog
G
Google Developers Blog
M
MIT News - Artificial intelligence
美团技术团队
腾讯CDC
V
Visual Studio Blog
aimingoo的专栏
aimingoo的专栏
博客园 - 聂微东
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Apple Machine Learning Research
Apple Machine Learning Research
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
博客园 - 叶小钗

Flags SDK Documentation

Global Config Bulk Evaluation Evaluation Context Precompute GrowthBook Hypertune PostHog Split Evaluation Context Quickstart Precompute Evaluation Context Quickstart Precompute GrowthBook Hypertune PostHog Split Proxy Dashboard Pages Marketing Pages Dashboard Pages Marketing Pages Data Locality Providers LaunchDarkly Optimizely Reflag Statsig Server-side vs Client-side
Edge Config
Vercel · 2026-04-03 · via Flags SDK Documentation

The @flags-sdk/edge-config package provides a basic adapter for defining feature flags powered by Vercel Edge Config

Learn more about Adapters

Follow the Quickstart, then add the Edge Config adapter.

Install desired dependencies

pnpm i @flags-sdk/edge-config

Set relevant variables

EDGE_CONFIG="edge-config-connection-string"
import { flag } from 'flags/next';
import { edgeConfigAdapter } from '@flags-sdk/edge-config';

export const exampleFlag = flag({
  // Will load the `flags` key from Edge Config
  adapter: edgeConfigAdapter(),
  // Will get the `example-flag` key from the `flags` object
  key: 'example-flag',
});

Your Edge Config should be managed on the dashboard as follows:

{
  // `flags` is the default used by the Edge Config adapter
  "flags": {
    // Flags using the adapter should have their `key` defined here
    "example-flag": true,
    "another-example-flag": false,
  }
}

edgeConfigAdapter

The adapter assumes that there is an EDGE_CONFIG environment variable set with a connection string, and that it contains a flags object with each key corresponding to a flag you define in code.

import { edgeConfigAdapter } from '@flags-sdk/edge-config';

export const exampleFlag = flag({
  adapter: edgeConfigAdapter(),
  key: 'example-flag',
});

createEdgeConfigAdapter

To customize these options you can import and call createEdgeConfigAdapter manually.

Option keyTypeDescription
connectionString`stringEdgeConfigClient`
options.edgeConfigItemKeystringDefaults to flags
options.teamSlugstringThe team slug used for your team in the Vercel dashboard, used to create links to your Edge Config
import { createEdgeConfigAdapter } from '@flags-sdk/edge-config';

const myEdgeConfigAdapter = createEdgeConfigAdapter({
  connectionString: process.env.OTHER_EDGE_CONFIG_CONNECTION_STRING,
  options: {
    edgeConfigItemKey: 'other-flags-key',
    teamSlug: 'my-vercel-team-slug',
  },
});

export const exampleFlag = flag({
  adapter: myEdgeConfigAdapter(),
  key: 'example-flag',
});

Read more about Edge Config, Flags SDK, and the Edge Config adapter.