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

推荐订阅源

小众软件
小众软件
博客园 - Franky
罗磊的独立博客
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
P
Proofpoint News Feed
Recent Announcements
Recent Announcements
V
V2EX
F
Fortinet All Blogs
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
U
Unit 42
GbyAI
GbyAI
A
About on SuperTechFans
WordPress大学
WordPress大学
Engineering at Meta
Engineering at Meta
雷峰网
雷峰网
Microsoft Azure Blog
Microsoft Azure Blog
Martin Fowler
Martin Fowler
D
DataBreaches.Net
The Cloudflare Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MongoDB | Blog
MongoDB | Blog

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.