Skip to main content

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

For Go, add definitions to Config in shipd.config.go, then run shipd push. See Define flags in code for the complete file.
2

Push it

The flag is created in every environment of the project. In the environment you push to, it is enabled and its Fallthrough serves the default (false). Push also regenerates TypeScript types or Go accessors according to your project settings.
3

Evaluate it

In React:
src/components/checkout.tsx
Pass "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 true to turn it on for everyone, or
  • click Add rule to turn it on for some users (by attribute or by percentage).
Click Save environment. Running SDK clients pick up the change on their next snapshot refresh.
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

Prefer defineFlags and shipd push so the repository stays the source of truth. See CLI reference.

Next