Integrate the Connect SDK into an Expo app

The Connect SDK captures visitors' interactions with mobile applications. You can integrate it into your Expo app and track the findings in the Acoustic Connect interface.

Language: TypeScript and JavaScript

Availability: Pro, Premium and Ultimate

Scope: This guide covers integrating the Connect SDK into an Expo managed workflow app for development and testing. For bare React Native, see Integrate the Connect SDK into a React Native app. For production configuration, see Move to production.

Requirements

  • Acoustic Connect subscription. You must register your app in Connect and get credentials for it (app key and collector URL). For instructions, see Generate Connect credentials for integration.

  • Development environment. Node.js 20 or later. Expo SDK 55 or later. Supported React Native versions: 0.82.0–0.85.x. iOS builds require Xcode 26 or later. A development build is required - Expo Go is not supported because the Connect SDK uses Nitro Modules, which require native code that Expo Go cannot load. Use expo-dev-client or EAS Build.

  • Peer dependency. react-native-nitro-modules at exactly the version pinned in the SDK's peerDependencies (currently 0.35.9). A version mismatch may cause the SDK to fail at startup - even a patch release can contain breaking changes to the native registration contract.

  • Mobile app compatibility. iOS 15.1–26.2, Android 8–16 (API 26–36). Android compileSdk 35 or later is required.

Known issues

  • Session replay accuracy (iOS). Session replay on iOS may show stale screen snapshots and does not track scroll position. Android is not affected.
  • Content inside a WebView component is not captured in session replay.
  • iPad is not supported. Due to changes introduced in iPadOS 14, the SDK does not support iPad.
  • Dual SIM features are in beta. Behavior using multiple carriers may be unreliable.

Initial setup

  1. From your project root, install the Connect library, its required peer dependency and the Expo build tooling.
npx expo install expo-dev-client expo-build-properties
npm install react-native-acoustic-connect [email protected]
npx expo install expo-dev-client expo-build-properties
npm install [email protected] [email protected]
  1. Open ConnectConfig.json and update the following values with your credentials. All other values are set to safe defaults and do not require changes for initial integration.
KeyValue
AppKeyYour Connect app key
PostMessageUrlYour collector URL
useReleaseSet to false for development (enables debug logging). Set to true before releasing to production.
  1. Add react-native-acoustic-connect and expo-build-properties to your app.json plugins.
{
  "expo": {
    "plugins": [
      "react-native-acoustic-connect",
      ["expo-build-properties", { "android": { "minSdkVersion": 26 } }]
    ]
  }
}
Why these plugins are needed

react-native-acoustic-connect wires ConnectConfig.json into the Android build at prebuild time so your credentials reach the native assets. Without it, the Android SDK uses placeholder credentials and reports to the wrong collector.

expo-build-properties raises Android minSdkVersion to 26, which is the Connect Android SDK minimum. Expo templates default to a lower value, and the Android build fails without this.

  1. Run expo prebuild to generate the native projects.
npx expo prebuild
⚠️

Warning

The values in ConnectConfig.json are baked into the native bundles at build time, not read at runtime. If you edit the file later, run expo prebuild again before rebuilding.

  1. Validate your configuration (recommended). doctor checks the things that otherwise fail late and confusingly at build time - Node version and ConnectConfig.json values (AppKey, PostMessageUrl). It's safe to re-run any time you change ConnectConfig.json.
npx acoustic-connect doctor
Warnings you can ignore during initial integration
  • KillSwitchUrl — not required for development. Set it before releasing to production.
  • iOSDevelopmentTeam — push-specific. Push notifications are outside the scope of this guide.
  1. Add the <Connect> wrapper to your app's root component. This is required for screen tracking, touch capture and keyboard event interception.
import { NavigationContainer } from '@react-navigation/native'

export default function App() {
  return (
    <NavigationContainer>
      {/* your screens */}
    </NavigationContainer>
  )
}
import { useNavigationContainerRef, NavigationContainer } from '@react-navigation/native'
import { Connect } from 'react-native-acoustic-connect'

export default function App() {
  const navigationRef = useNavigationContainerRef()

  return (
    <Connect
      navigationRef={navigationRef}
      captureKeyboardEvents={true}
    >
      <NavigationContainer ref={navigationRef}>
        {/* your screens */}
      </NavigationContainer>
    </Connect>
  )
}
  1. Build and run your app.
npx expo run:ios
npx expo run:android

Verify the SDK is running

The SDK auto-initializes at module load using the values from ConnectConfig.json. With "useRelease": false in your config (the default), verbose native logging from Connect, Tealeaf and EOCore is written to the Xcode console (iOS) and Logcat (Android). Confirm that the SDK is initializing, capturing screen views, and posting to the collector.

Enable debug logging

Add these environment variables with a value of 1 to your scheme so the Xcode console shows verbose native logging: CONNECT_DEBUG, TLF_DEBUG and EODebug. Without this step, no verbose native logging appears even with useRelease: false set.

Connect SDK environment variables

If you have a Connect Ultimate subscription, you can also verify the integration visually: open Behavior studio > Sessions > Session replay and confirm that your session appears and renders correctly.

Troubleshooting

npm install peer-dependency conflict on react-native-nitro-modules

The SDK pins react-native-nitro-modules to an exact version. If npm install reports a peer conflict, your project is resolving a different version. Check the resolved version with npm ls react-native-nitro-modules and align it to the version declared in the SDK's peerDependencies. See Requirements above.

Using --legacy-peer-deps or --force silences the error but does not resolve the underlying mismatch; a version conflict can cause the SDK to fail at startup.

ConnectConfig.json not created after npm install

The file is created by a postinstall script that only runs when npm actually installs packages. If the SDK was already listed in package.json before you ran npm install, npm may skip the script with an "up to date" message. To create the file manually, run:

node node_modules/react-native-acoustic-connect/scripts/postinstall.mjs

Next steps


Did this page help you?