React Native installation
Requirements
Section titled “Requirements”- React Native 0.75 or later. The package is built and tested on React Native 0.88 with the New Architecture; if you are on an older version or the old architecture and something does not build, tell us.
- iOS 15 or later, Android
minSdk23 or higher - The team’s SDK key (
rsk_…) from the form’s Share → Mobile app tab
The package is a native module. It supports the New Architecture (TurboModule) and falls back to the old architecture. It does not run in Expo Go.
Install
Section titled “Install”The package is @responsly/react-native-sdk. It is not on the public npm registry. Make it available to your project as described in your access details, then add it.
npm install @responsly/react-native-sdkcd ios && pod installAutolinking does the rest. The package contains the native iOS and Android SDK sources, so you do not add a CocoaPods source, a Maven repository or a native dependency yourself.
npx expo install @responsly/react-native-sdkAdd the config plugin. It takes no options.
{ "expo": { "plugins": ["@responsly/react-native-sdk"] }}Then create a development build:
npx expo prebuildnpx expo run:iosnpx expo run:androidOr build with EAS using a development profile. Expo Go cannot load the SDK because it contains native code. See Troubleshooting.
Platform minimums
Section titled “Platform minimums”If the build fails on a deployment target or minSdk error, raise the project’s minimums.
platform :ios, '15.0'buildscript { ext { minSdkVersion = 23 }}In Expo, set them with the expo-build-properties plugin instead of editing native files.
Initialize
Section titled “Initialize”Call initialize once at the app root, outside of any component, so it runs before the first screen renders.
import { AppRegistry } from 'react-native'import Responsly from '@responsly/react-native-sdk'import App from './App'import { name as appName } from './app.json'
Responsly.initialize('rsk_…', { logLevel: __DEV__ ? 'debug' : 'error' })
AppRegistry.registerComponent(appName, () => App)With Expo Router, put the call at module level in the root layout:
import { Stack } from 'expo-router'import Responsly from '@responsly/react-native-sdk'
Responsly.initialize('rsk_…', { logLevel: __DEV__ ? 'debug' : 'error' })
export default function RootLayout() { return <Stack />}Calls made before initialize (identify, track, screen and the rest) are remembered and applied when the SDK starts. initialize is idempotent for the same key, so Fast Refresh is not a problem.
Options
Section titled “Options”| Field | Values | Notes |
|---|---|---|
logLevel | 'none', 'error', 'info', 'debug' | Use 'debug' while integrating. See Testing & debugging. |
apiHost | string | Defaults to https://api.responsly.com. Leave it unset unless Responsly support gives you another host. |
Screen tracking helpers
Section titled “Screen tracking helpers”The package adds two helpers on top of the native API:
createNavigationTracker(navigationRef)reports the active React Navigation route as the current screen.useResponslyScreen(name)reports a screen from inside a component.
Both are shown in Track events & screens.