Overview
This page connects the pieces you’ll see across the docs. If you remember one thing: you define flags in code, you control them in the dashboard, and your app evaluates them in memory.Where things live
How a flag gets to your app
Go uses the same flow withshipd.config.go, read directly by the CLI. Version-1 JSON configs are also supported. See Go definitions.
- Define. TypeScript or Go definitions declare which flags exist and their types; The CLI reads Go definitions directly. It’s reviewed in pull requests like any other code.
- Sync.
shipd pushcompares the file with shipd and applies the difference. It also writes TypeScript types or Go accessors for your flags. - Control. In the dashboard you decide what each flag serves per environment: on or off, rules for specific users, percentage rollouts.
- Publish. Every change produces a new snapshot version for the affected environment.
- Deliver. The SDK downloads the snapshot at startup, then refreshes it every 30 seconds, or on a WebSocket notification in TypeScript streaming clients.
- Evaluate. TypeScript’s
isEnabled,getVariant,getNumber, andgetJson, and Go’sIsEnabled,GetVariant,GetNumber, andGetJSON, read the in-memory snapshot and never throw. See SDK benchmarks for measured boolean evaluation latency and throughput.
How a value is chosen
For each check, the SDK walks this list and stops at the first match:shipd push sets the fallthrough of the environment you push to from the flag’s default in your flag definitions, and resets it if the two differ. Other environments’ fallthroughs are only changed in the dashboard.
The evaluation context is who is asking: a userId plus attributes such as plan or country. Rules match on it. Percentage rollouts hash the flag key and userId, so the same user always gets the same answer.
Two kinds of credentials
SDK keys only read snapshots. The others only change configuration. Neither works in place of the other. See Keys and tokens.
What this means in practice
- Your app doesn’t wait on shipd. Flag checks are in memory. If shipd is down, the SDK keeps the last snapshot it had, or serves your
defaults. - Code owns what exists; the dashboard owns what’s served. Add or change flag definitions and run
shipd push. To archive a flag, remove its definition and runshipd push --pruneafter reviewing the plan. Turn them on, target users, and roll out in the dashboard. - Environments share definitions, not state. Adding a flag adds it everywhere. Turning it on in
stagingdoesn’t touchproduction. - Always pass
defaults. They are what your users get before the first snapshot arrives and whenever shipd can’t be reached.
Go deeper
- Architecture: control plane, data plane, and realtime updates
- Local evaluation: the hot path and failure modes
- Environments: production protection and per-environment state
- Snapshots: the document the SDK evaluates
- Glossary: every term, defined once