@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:- 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.
- 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. - 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.
How you present a flow
You present a flow declaratively: resolve aFlowSession for the placement, then render it with the <FlowPilotPresenter session={...} /> component. This is the one supported render path on the Expo SDK, and it is covered in Presenting placements:
FlowPilot.resolveSession('key')is the non-throwing resolver. It returns a ready session, ornullwhen nothing is presentable so your app can render its own UI. Recommended for must-not-fail entry points like onboarding.FlowPilot.createSession('key')does the same resolution but throws when there is no presentable flow, for when you would rathertry/catchthan null-check.
Before you startYou need:
- A FlowPilot workspace.
- An app inside that workspace.
- An SDK API key for that app.
Requirements
Requirements- Expo SDK 51+ (managed or bare workflow)
- React Native 0.74+
- React 18+
- TypeScript 5.4+ (optional, but recommended)
expo-image, expo-font, expo-haptics, expo-linear-gradient, 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.