Skip to main content

Overview

Jordan adds the new checkout nav to Fieldkit’s React app. Hooks are bound once in a client-only module so server code can import FlagDefinitions without pulling React. shipd’s own dashboard does this via (useFlag("audit-log"), useVariant("rules-editor")).

Bind hooks

src/lib/shipd.ts
Do not put createShipdReact in typegen output. shipd pull / types gen emit types only.

Create the client and wrap

src/app/providers.tsx
Identify from your auth layer — hooks subscribe through client.subscribe:

Read flags

src/components/CheckoutNav.tsx
useFlag("search-variant") does not type-check — that key is a variant. useVariant("new-checkout") does not type-check either. Hooks re-render when a new snapshot applies or when identify / reset changes context.

Dogfood: the shipd dashboard

apps/web/src/lib/shipd.ts
Empty env keys skip the data plane and keep defaults (rules-editor: "v1", audit-log: false) so local dashboard boots without hosted KV.

Next