@flowpilotjs/react-native-sdk, published publicly on npm.
Requirements
Requirements- Expo SDK 51+ (managed or bare workflow)
- React Native 0.74+
- React 18+
- TypeScript 5.4+ (optional, but recommended)
react-native-webview (required — flows render in it), plus expo-image, expo-font, expo-haptics, expo-linking, expo-file-system, expo-secure-store, expo-store-review and react-native-safe-area-context.
Upgrading from 1.x: react-native-reanimated, react-native-svg, @react-native-community/slider, lottie-react-native and expo-linear-gradient are no longer needed — they belonged to the renderer 2.0 replaced — and react-native-webview changed from optional to required.
Steps
1
Install the SDK package
2
Install the peer dependencies
The SDK declares its Expo modules as peer dependencies, so you install them in your app. Use
npx expo install (not plain npm install) so Expo picks versions that match your SDK version.react-native-webview is required: flows are drawn by the FlowPilot runtime, which lives in a WebView. The rest are lazy-loaded with require() on first use, so a missing one degrades gracefully (no haptics, no disk cache) instead of crashing at import. Install all of them anyway so every feature works.3
Rebuild and import
After adding the plugin, do a clean start so the change takes effect. Then import the SDK where you use it.
Wrap your app in a safe-area provider
The renderer reads safe-area insets throughreact-native-safe-area-context. If your app is not already wrapped in a SafeAreaProvider, add one near the root so flows can lay out around the notch and home indicator.
Notes
- No native modules of its own. The SDK is pure JS/TypeScript. It runs in the Expo managed workflow without any custom native code or config plugin. Its only native code comes from the peer dependencies, which are all standard Expo modules.
flowpilot-exportis a build-time CLI, not part of your bundle. The package also ships a Node executable (flowpilot-export) that snapshots a flow into an offline bundle. You run it withnpx flowpilot-exporton a dev machine or in CI; it is never imported by your app at runtime. See Offline and bundled flows.
Common mistakes
- Using
npm installfor the peer dependencies. Usenpx expo installso the Expo module versions match your Expo SDK version. Mismatched native module versions are a common source of build errors. - Forgetting
react-native-webview. Without it the SDK cannot present anything; it says so in the log rather than showing a blank screen. - Not doing a clean rebuild after adding the plugin. Babel caches; run
npx expo start --clear(or rebuild your dev client) so the plugin is applied. - No
SafeAreaProvider. Without one,useSafeAreaInsetsreturns zeros and flows can render under the status bar or home indicator.
Troubleshooting
- Nothing appears and the log says the runtime cannot start.
react-native-webviewis missing, or a dev client was not rebuilt after adding it. Runnpx expo install react-native-webview, thennpx expo start --clear(ornpx expo prebuildfor a bare/dev-client workflow). Unable to resolve module expo-...A peer dependency is not installed. Re-run thenpx expo install ...command above.- Type errors importing the SDK. Confirm TypeScript 5.4+ and that
@flowpilotjs/react-native-sdkresolved intonode_modules.