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

推荐订阅源

博客园_首页
IT之家
IT之家
博客园 - Franky
Stack Overflow Blog
Stack Overflow Blog
宝玉的分享
宝玉的分享
Recent Announcements
Recent Announcements
Engineering at Meta
Engineering at Meta
S
SegmentFault 最新的问题
V
Visual Studio Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Last Week in AI
Last Week in AI
H
Help Net Security
V
V2EX
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
博客园 - 叶小钗
J
Java Code Geeks
博客园 - 【当耐特】
月光博客
月光博客
爱范儿
爱范儿
人人都是产品经理
人人都是产品经理
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件

Flags SDK Documentation

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 Flags as Code
Global Config
Vercel · 2026-08-05 · via Flags SDK Documentation

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

Learn more about Adapters

Follow the Quickstart, then add the Global Config adapter.

Install desired dependencies

pnpm i @flags-sdk/global-config

Set relevant variables

GLOBAL_CONFIG="global-config-connection-string"
import { flag } from 'flags/next';
import { globalConfigAdapter } from '@flags-sdk/global-config';

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

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

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

globalConfigAdapter

The adapter assumes that there is an GLOBAL_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 { globalConfigAdapter } from '@flags-sdk/global-config';

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

createGlobalConfigAdapter

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

Option keyTypeDescription
connectionString`stringGlobalConfigClient`
options.globalConfigItemKeystringDefaults to flags
options.teamSlugstringThe team slug used for your team in the Vercel dashboard, used to create links to your Global Config
import { createGlobalConfigAdapter } from '@flags-sdk/global-config';

const myGlobalConfigAdapter = createGlobalConfigAdapter({
  connectionString: process.env.OTHER_GLOBAL_CONFIG_CONNECTION_STRING,
  options: {
    globalConfigItemKey: 'other-flags-key',
    teamSlug: 'my-vercel-team-slug',
  },
});

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

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

PreviousGrowthBookNextLaunchDarkly