Migrate Blueprint flags
Convert Blueprint flag definitions to the current Global Config format
Use the migration command to convert Blueprint flag definitions in Vercel Global
Config to the format used by @octopus-energy/flags.
Install the required packages
npm i @octopus-energy/flags @vercel/global-configConfigure access
Set the Global Config connection string and a Vercel API token:
GLOBAL_CONFIG="https://global-config.vercel.com/ecfg_...?token=[redacted]"
VERCEL_API_TOKEN="[redacted]"Run the migration
Run the command to read Blueprint flags from flags and write approved flags to
oe-flags:
npm exec oe.flags global-config migrateReview each proposal, then approve, edit, or discard it.
To edit a proposal, set the VISUAL or EDITOR environment variable to the editor the command
should open.
To use different Global Config item keys:
npm exec oe.flags global-config migrate --from blueprint-flags --to flagsSwitch to the migrated flags
Check the destination item in Vercel, then update the Global Config adapter to read from it:
import { createGlobalConfigAdapter } from "@octopus-energy/flags/global-config";
export const adapter = createGlobalConfigAdapter({ key: "oe-flags" });Regenerate typed declarations if your project uses them:
npm exec oe.flags generate --global-config oe-flags --out generated/flags.d.tsDeploy and verify the migrated flags before removing the old item.