For the complete documentation index, see llms.txt. Prefer markdown by appending.mdto documentation URLs or sendingAccept: 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.DEMOships as a working example) - Platform package
@workspace/flags-extensionwith React hooks for the extension UI - 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 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:
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:
In-memory
Local defaults, zero config. Great for development.
PostHog
Flags next to analytics and monitoring.
GrowthBook
Dedicated experimentation and targeting.
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