Skip to main content

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 with shipd.config.go, read directly by the CLI. Version-1 JSON configs are also supported. See Go definitions.
  1. 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.
  2. Sync. shipd push compares the file with shipd and applies the difference. It also writes TypeScript types or Go accessors for your flags.
  3. Control. In the dashboard you decide what each flag serves per environment: on or off, rules for specific users, percentage rollouts.
  4. Publish. Every change produces a new snapshot version for the affected environment.
  5. Deliver. The SDK downloads the snapshot at startup, then refreshes it every 30 seconds, or on a WebSocket notification in TypeScript streaming clients.
  6. Evaluate. TypeScript’s isEnabled, getVariant, getNumber, and getJson, and Go’s IsEnabled, GetVariant, GetNumber, and GetJSON, 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:
The fallthrough is what an environment serves when no rule matches. 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.
Disabling a flag does not turn it off. It skips targeting rules and serves the fallthrough. To turn a feature off, set Fallthrough to false. See Turn a feature off immediately.
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 run shipd push --prune after 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 staging doesn’t touch production.
  • Always pass defaults. They are what your users get before the first snapshot arrives and whenever shipd can’t be reached.

Go deeper