AIFeed

Flags SDK 现可在 Vercel 上无需 FLAGS_SECRET 运行

AI summary

从 [email protected] 起,Vercel 上的项目无需 FLAGS_SECRET 即可使用 Flags Explorer 和预计算功能,从而省去了新项目的配置步骤,也不再需要在多个微前端之间同步共享密钥。现有项目在环境变量仍设置或在代码中传入密钥时会继续使用 FLAGS_SECRET,仅升级不会切换到 Vercel 托管密钥;本地开发可运行 vercel env pull,而无密钥的预计算代码仅在创建它的部署中有效。

Translation(model translation, not the source's own text)
题图
题图

在 [email protected] 中,Vercel 上的项目无需 FLAGS_SECRET 即可使用 Flags Explorer 和 precompute。这为新项目省去了一步设置,也无需再在多个微前端之间保持共享密钥同步。

Vercel 会为 Flags Explorer 的发现请求和覆盖签名,SDK 则使用 Vercel 的公钥加密 Vercel Toolbar 中显示的 flag 值。

现有项目在环境变量仍然设置、或在代码中传入密钥的情况下,会继续使用 FLAGS_SECRET。仅升级不会将它们切换到 Vercel 托管的密钥。若要为这些功能使用 Vercel 托管的密钥,请移除该环境变量以及任何显式传入密钥的代码。本地开发时,运行 vercel env pull。

在没有密钥的情况下创建的预计算代码仅在创建它的部署中有效。无密钥预计算需要 Vercel 系统环境变量,这些变量默认启用。预构建部署以及必须跨部署生效的代码仍然需要密钥;如果只有预计算需要密钥,请使用 FLAGS_PRECOMPUTE_SECRET。如果使用构建缓存,请参阅 precompute 文档了解所需配置。

在 Flags SDK 文档中了解更多。

Only about 681 characters could be extracted — the rest did not come through (common on sites that need scrolling or a login). Read the original for the full piece.

Published by Vercel Blog
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗