Overview
In this guide you add a boolean flag,new-checkout, in TypeScript or Go, push it, branch on it in code, and turn it on from the dashboard.
You need the shipd CLI signed in (shipd login) and an SDK client. See the Quickstart if you have neither.
Steps
1
Define the flag
Config in shipd.config.go, then run shipd push. See Define flags in code for the complete file.2
Push it
default (false). Push also regenerates TypeScript types or Go accessors according to your project settings.3
Evaluate it
src/components/checkout.tsx
"new-checkout": false in the client’s defaults so the flag stays off before the first snapshot arrives. See isEnabled.4
Turn it on
In the dashboard, open the project, click
new-checkout, and select the environment. Then either:- set Fallthrough to
trueto turn it on for everyone, or - click Add rule to turn it on for some users (by attribute or by percentage).
shipd push sets Fallthrough in the target environment back to the config default when they differ. After you change Fallthrough in the dashboard, update default in your flag definitions (or run shipd pull) so the next push doesn’t revert it. See Push, pull, and diff.Create it without a config file
defineFlags and shipd push so the repository stays the source of truth. See CLI reference.