跳到正文
Vercel Blog(vercel.com)· Vincent Derks·· 3 小時前品質評分62

Vercel Flags 允許跨專案評估旗標,無需共享 SDK 金鑰

Evaluate Vercel Flags from another project without sharing SDK keys.

重點導讀

Vercel Flags 允許同一團隊內不同專案之間讀取旗標,無需手動管理 SDK 金鑰。

  • 連線功能:在 Connections 頁面可新增/移除專案連結,授予只讀許可權,支援所有環境。

AI 伴隨問答

自備 Key 深度分析

針對這篇報導有疑問?可直接點選快捷問題或向 AI 追問背景脈絡與技術細節:

正文

Project Connections let applications evaluate flags defined in another Vercel project within the same team, without managing SDK keys.

The Connections page shows which projects can read your project’s flags and which projects your project reads flags from, with controls to add or remove connections.The Connections page shows which projects can read your project’s flags and which projects your project reads flags from, with controls to add or remove connections.

The Connections page shows which projects can read your project’s flags and which projects your project reads flags from, with controls to add or remove connections.

Previously, sharing flags between projects required copying a server SDK key into an environment variable and managing it manually. Connected projects authenticate using their deployment’s identity. For local development, vercel env pull retrieves your project’s OIDC token.

Manage access from the Connections page under your project's Flags section, or with vercel flags connections in the CLI. Connections grant read-only access across all environments. The consumer deployment determines the flag environment (production deployments evaluate production flags).

In the consumer application, create an adapter with the source project’s ID.

flags.ts

import { flag } from 'flags/next';

import { createVercelAdapter } from '@flags-sdk/vercel';

const sharedFlagsAdapter = createVercelAdapter({

projectId: 'prj_source',

});

export const newCheckout = flag<boolean>({

key: 'new-checkout',

defaultValue: false,

adapter: sharedFlagsAdapter(),

});

Evaluate a flag defined in the connected source project.

Access can be revoked without redeploying.

Project Connections are available on all plans and require @flags-sdk/vercel 1.6.0 or later, or @vercel/flags-core 1.11.0 or later when using the core library directly. Managing connections from the CLI requires Vercel CLI 63.0.0 or later.

Learn more in the Vercel Flags documentation

來源: Vercel Blog (vercel.com)
開啟原文

讀者討論

理性交流 · 即時討論