react-native-reanimated Babel plugin. The package is @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)
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.
Steps
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.The SDK lazy-loads the Expo modules (
expo-haptics, expo-linking, expo-font, expo-file-system, expo-secure-store, expo-image) with require() on first use, so a missing module degrades gracefully (for example, no haptics) instead of crashing at import. Install all of them anyway so every feature works.Add the Reanimated Babel plugin
Animations and transitions use
react-native-reanimated, which needs its Babel plugin. Expo SDK 51 sets this up for you in new projects; add it by hand if your babel.config.js does not already list it. It must be the last plugin.babel.config.js
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 the Reanimated plugin. Without
react-native-reanimated/plugininbabel.config.js(as the last plugin), the app throws at startup. See Troubleshooting below. - 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
[Reanimated] Couldn't determine the version of the native part...The Babel plugin is missing or the app was not rebuilt. Addreact-native-reanimated/pluginas the last plugin inbabel.config.jsand runnpx 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.