For the complete documentation index, see llms.txt. Prefer markdown by appending .md to documentation URLs or sending Accept: text/markdown.

Configuration

Choose an OpenFeature provider for Expo flags: in-memory for local defaults, or PostHog / GrowthBook for remote rollouts.

The @workspace/flags-mobile package wraps OpenFeature providers behind a single client strategy. Swap the active provider by changing the re-exports in packages/flags/mobile/src/providers/index.ts, then set any env vars that provider needs.

The default provider is in-memory. You can evaluate Flag.DEMO in the simulator with no third-party account. Connect PostHog or GrowthBook when you need remote targeting or a dashboard.

Providers

Feature flags let you control product rollouts, experiments, and UI toggles—without shipping new code. In Expo, you can choose a simple in-memory provider for hardcoded defaults, or connect a remote provider (like PostHog or GrowthBook) to target segments and manage flags centrally.

This guide explains each provider and how to enable it for your app.

Flags provider

Hooks need OpenFeature in the React tree. The kit already mounts FlagsProvider from apps/mobile/src/lib/providers/flags.tsx inside the root providers. It also syncs the signed-in user into targeting context:

apps/mobile/src/lib/providers/flags.tsx
import { useEffect } from "react";

import {
  clearContext,
  FlagsProvider as Provider,
  setContext,
} from "@workspace/flags-mobile";

import { authClient } from "~/lib/auth";

export const FlagsProvider = ({ children }: { children: React.ReactNode }) => {
  const session = authClient.useSession();

  useEffect(() => {
    if (session.isPending) {
      return;
    }

    if (session.data?.user) {
      const { id, email, name } = session.data.user;
      void setContext({ targetingKey: id, email, name });
      return;
    }

    void clearContext();
  }, [session]);

  return <Provider>{children}</Provider>;
};

After that, useBooleanFlagValue and the other hooks from @workspace/flags are safe to use in screens. More detail in Usage.

How is this guide?

Last updated on

On this page

Ship your startup everywhere. In minutes.Try TurboStarter