For the complete documentation index, see llms.txt. Prefer markdown by appending.mdto documentation URLs or sendingAccept: text/markdown.
Overview
Ship feature flags on the web with OpenFeature. Local in-memory defaults, PostHog or GrowthBook in production, and the same API on client and server.
Feature flags let you turn product behavior on and off without a redeploy. Roll out a new settings page to a cohort, hide unfinished UI behind a key, or A/B test a CTA, all from one evaluation API.
TurboStarter wires this through OpenFeature so your app code stays provider-agnostic. You evaluate flags the same way whether you use the built-in in-memory provider, PostHog, or GrowthBook.
Out of the box you get:
- Shared flag keys in
@workspace/flags(Flag.DEMOships as a working example) - Platform package
@workspace/flags-webwith client hooks and server evaluators - A
FlagsProviderthat syncs targeting context from the signed-in user (targetingKey,email,name) - In-memory provider as the default (no account required for local development)
- Optional PostHog and GrowthBook providers, swapped by changing a few exports
The demo flag is already evaluated on Dashboard → Settings. With the default in-memory config it renders a banner that links back here, so you can confirm the pipeline before connecting a remote provider.
Architecture
Flags live in a small monorepo slice next to analytics and billing:
App wiring sits in apps/web/src/lib/providers/flags.tsx and is mounted with the rest of your providers. When a session appears, context is set; on logout it is cleared. PostHog uses that to identify / reset so remote rules can target real users.
Providers
Pick the backend that matches how you want to manage rollouts:
In-memory
Local defaults, zero config. Great for development.
PostHog
Flags next to analytics and monitoring.
GrowthBook
Dedicated experimentation and targeting.
Switch providers by updating the exports under packages/flags/web/src/providers. Your React and server evaluation code stays the same.
In the following sections you'll learn how to configure and use the providers.
How is this guide?
Last updated on