Overview
Maya is wiring feature flags into Fieldkit’sweb-app. In this guide she creates a boolean toggle called new-checkout, syncs it to production, and evaluates it in a Node process.
Time: a few minutes. You need Node.js 20+ and a shipd account.
1. Install the CLI
2. Log in
/auth/device/code. Pick organization → project → environment (Maya picks fieldkit → web-app → production). Approval stores a management API key in ~/.config/shipd/credentials.json.
3. Define the flag
Createshipd.config.ts next to package.json:
shipd.config.ts
shipdit is the SDK package. defineFlags lives at shipdit/config.
4. Push and generate types
shipd push diffs local definitions against the server, applies them, then writes src/generated/flags.ts.
Creating or updating a definition (type, variants, tags, lifecycle) needs production permission even when
--env is staging. Defaults are per environment. See Environments.5. Evaluate it
src/checkout.ts
sdkKey.create). Server keys look like shipd_sdk_server_…. The secret is shown once.
A misspelled key is a TypeScript error:
Next
Define more flags
Variants, numbers, JSON — still in
shipd.config.ts.Evaluate in the browser
shipdit/client, polling, and WebSocket invalidation.Target a user
identify, traits, and userId.React
ShipdProvider + useFlag.