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 in your browser extension with OpenFeature. Local in-memory defaults, PostHog or GrowthBook for remote rollouts, and targeting from the signed-in user.

Feature flags let you change extension behavior without waiting on store review. Gate a new options panel, roll out a content-script tweak to a cohort, or experiment on popup copy while the packaged build stays stable.

TurboStarter uses OpenFeature so evaluation stays provider-agnostic. Swap between the built-in in-memory provider, PostHog, or GrowthBook without rewriting your UI.

Out of the box boilerplate provides you with:

  • Shared flag keys in @workspace/flags (Flag.DEMO ships as a working example)
  • Platform package @workspace/flags-extension with React hooks for the extension UI
  • 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 provider exports

The demo flag is already evaluated on the Options page. With the default in-memory config it shows a banner that links back here, so you can verify evaluation before connecting a remote provider.

Client-only in the extension

Unlike the web kit, the extension evaluates flags on the client. Prefer hooks such as useBooleanFlagValue in popup, options, and other React surfaces.

Architecture

Flags live next to analytics in the monorepo:

keys.ts - Flag key constants
in-memory.ts - Default local definitions
react.tsx - createFlagsReact + hooks
index.tsx - FlagsProvider, setContext, clearContext

App wiring sits in apps/extension/src/lib/providers/flags.tsx and mounts with the shared layout providers. When a session appears, context is set; on logout it is cleared. The PostHog strategy identifies users for person-based rules without turning on full web autocapture (better for extension surfaces).

Providers

TurboStarter includes native support for multiple feature flag providers and offers a unified API for flag evaluation. This approach allows you to monitor feature usage and user behavior consistently throughout your extension.

For details on configuring each provider, refer to their sections below:

Configuration and setup are seamlessly integrated with a unified API, so you can switch providers just by changing the exports. You can also add custom providers without affecting any flags-related logic.

In the following sections, you'll learn how to set up each provider and how to evaluate flags in your application.

How is this guide?

Last updated on

On this page

Ship your startup everywhere. In minutes.Try TurboStarter