Skip to main content
The FlowPilot React Native SDK (@flowpilotjs/react-native-sdk) turns a placement key into a native flow on screen inside an Expo app. You configure it once at launch, then ask it to present a placement. The SDK resolves which flow to show, renders it as native React Native views, and reports how the user finished. It is the JavaScript / TypeScript counterpart of the iOS Swift SDK. The two SDKs share the same flow JSON schema and aim for pixel-parity, so a flow built once in the dashboard renders the same on both.

What it does

The SDK does three things for every placement you present:
  1. Resolve. It asks the FlowPilot backend which flow (and which experiment variant, if any) to show for this placement, user, and audience. Results are cached, so the next present is fast.
  2. Render. It draws the resolved flow as native React Native components. There is no web view. Components, layout, animations (via react-native-reanimated), and persistent UI zones all render natively.
  3. Report. It emits analytics events automatically (flow_start, screen_view, flow_complete, and more), lets you forward them to your own analytics, and tracks conversions for revenue attribution.
The SDK is built to fail safe. If a resolve fails or times out, it falls back to the last cached flow, then a bundled default you ship in the app, then your own native UI. Adding FlowPilot does not add a way to crash or block your app. See Caching and Offline and bundled flows for the full fallback chain.

How you present a flow

There are two presentation paths, both covered in Presenting placements:
  • Imperative (FlowPilot.presentPlacement('key')) opens a full-screen modal and resolves a promise with the outcome. Use it when you just need a flow shown.
  • Declarative (FlowPilot.createSession('key') plus the <FlowPilotPresenter session={...} /> component) gives you control over safe-area handling and lets you embed the flow in your own view tree.
Before you startYou need:

Requirements

Requirements
  • Expo SDK 51+ (managed or bare workflow)
  • React Native 0.74+
  • React 18+
  • TypeScript 5.4+ (optional, but recommended)
The SDK ships no native modules of its own. It is pure JS/TypeScript and relies on a set of Expo peer dependencies (expo-image, expo-font, expo-haptics, expo-linking, expo-file-system, expo-secure-store, expo-store-review, react-native-reanimated, react-native-safe-area-context, react-native-svg, @react-native-community/slider, lottie-react-native) that you install in your app.

Where to go next

Installation

Add the package and its peer dependencies to your Expo app.

Configuration

Initialize the SDK at launch with your API key and App ID.

Quickstart

Configure, present a placement, and read the result.