Skip to Content
Octopus Energy Packages

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-config

Configure 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 migrate

Review 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 flags

Switch 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.ts

Deploy and verify the migrated flags before removing the old item.

FAQ

On this page