Flags docs
Guides

Build with Flags.

Twelve guides, each one self-contained. Start with getting started if you have not created a flag yet.

Every code sample on these pages is compiled against the published @productcraft/flags packages before the docs ship. Looking for one endpoint? See the API reference.


Guides

The guides

01 · Percentage rollouts

Staff first, then 10%, 50%, everyone: sticky buckets, the split attribute, and what anonymous users get.
Read more

02 · Segments

One "Beta testers" list reused across flags, hashed emails, adding a tester without retyping the list.
Read more

03 · OpenFeature

The ProductCraftFlagsProvider for the OpenFeature server SDK: context mapping, reasons, events, tests.
Read more

04 · Webhooks

config.published and sdk_key.rotated: filter by environment, verify the signature, read what changed.
Read more

05 · Testing with overrides

Local values, a JSON file or an environment variable; createTestClient in unit tests; test evaluation against the live config.
Read more

06 · Config JSON and evaluation

The config JSON (schema 1), the evaluation spec and the test vectors, for authors of SDKs in other languages.
Read more

07 · Fail-safe and caching

What your app evaluates when Flags is slow or down: the held config, your cache, the bootstrap, your defaults.
Read more

08 · Migrating from ConfigCat

Concept and SDK maps, the importer, sticky buckets, hashed values, a dual-run check and the cutover checklist.
Read more

09 · React and Next.js

FlagsProvider and useFlag, server rendering from a bootstrap without a flash, and which key may ship to a browser.
Read more

10 · Serverless and edge

Lazy polling with a shared cache for functions, and the engine on its own at the edge.
Read more

11 · Kill-switch runbook

Turn a feature off for everyone during an incident, know when every app has it, and restore the targeting after.
Read more

12 · Flag cleanup

Lifecycles, the stale-flag report and weekly digest, removing a flag from code and then from Flags, with an AI agent if you like.
Read more

13 · Approvals: agents propose, people approve

Who must propose in each environment, change requests from API keys and AI agents, review, apply, rebase.
Read more

14 · Scheduled changes and ramps

Turn a flag on at a set time and roll it out 5% → 25% → 50% → 100% over days, with pause and stop.
Read more

Packages

Which package do I need?

  • @productcraft/flags: the FlagsClient that downloads and evaluates configs (Node, browsers, serverless), and the Flags management client for scripts.
  • @productcraft/flags-react: FlagsProvider and useFlag for React and Next.js.
  • @productcraft/flags-openfeature: a provider for the OpenFeature server SDK.
  • @productcraft/flags-engine: the evaluation engine on its own, with no network code, for edge runtimes and for authors of SDKs in other languages.