Cleaning up after a full rollout
Once a feature is stable and the flag has been enabled in all environments for a while, remove it from your codebase and dashboard.
vercel flags list --state activevercel flags inspect old-onboarding-flowCheck the output to confirm the flag is enabled in all environments and hasn't been changed recently.
Search your codebase for the flag key and its camelCase variant:
rg "old-onboarding-flow" --type ts
rg "oldOnboardingFlow" --type tsDelete the flag() declaration from your flags.ts file.
Keep only the code path that was behind the enabled flag:
const show = await oldOnboardingFlow();
return show ? <NewOnboarding /> : <OldOnboarding />;return <NewOnboarding />;Delete any component files that are no longer referenced.
vercel deployVisit the preview URL to confirm the feature still works without the flag.
vercel deploy --prodArchived flags evaluate to the default value defined in code, so remove the flag from your code and deploy to every environment that uses it before archiving.
Once the code removal is live in every environment, archive the flag:
vercel flags archive old-onboarding-flowThe command reports evaluations from the last 3 days before asking for confirmation. If you need the flag back, vercel flags unarchive old-onboarding-flow restores it with its configuration and history.
See Archive for details on what happens when you archive.
Was this helpful?