For the complete documentation index, see llms.txt. Prefer markdown by appending .md to documentation URLs or sending Accept: 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.DEMO ships as a working example)
  • Platform package @workspace/flags-web with client hooks and server evaluators
  • A FlagsProvider that 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:

keys.ts - Flag key constants
in-memory.ts - Default local definitions
react.tsx - createFlagsReact + hooks
server.ts - createFlagsServer helpers
index.tsx - FlagsProvider, setContext, clearContext
server.ts - getBooleanValue, getStringValue, …

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:

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

On this page

Ship your startup everywhere. In minutes.Try TurboStarter