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. Expo SDK 56–57. Node.js 20.19.4–20.x, 22.13–22.x or 24.3–24.x. On Expo SDK 55, you can install the previous SDK line (19.0) as shown in step 1, but it doesn't include 19.1 fixes. Upgrade to Expo SDK 56 or later to get them. Expo SDK 57 doesn't build on Xcode 26.3; use a newer Xcode. 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-modulesat exactly the version pinned in the SDK'speerDependencies(currently 0.37.1 for SDK 19.1; 0.35.9 for SDK 19.0). 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.5, Android 8–16 (API 26–36). Android
compileSdk35–36 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
WebViewcomponent 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
- 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@^19.1.1 [email protected]npx expo install expo-dev-client expo-build-properties
npm install react-native-acoustic-connect@~19.0.34 [email protected]- 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.
| Key | Value |
|---|---|
AppKey | Your Connect app key |
PostMessageUrl | Your collector URL |
useRelease | Set to false for development (enables debug logging). Set to true before releasing to production. |
- Add
react-native-acoustic-connectandexpo-build-propertiesto yourapp.jsonplugins.
{
"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.
- Run
expo prebuildto generate the native projects.
npx expo prebuild
WarningThe 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 prebuildagain before rebuilding.
-
Validate your configuration (recommended).
doctorchecks the things that otherwise fail late and confusingly at build time:- Node.js version
- ConnectConfig.json values (
AppKey,PostMessageUrl,KillSwitchUrl) - App identifiers in app.json (
android.packageandios.bundleIdentifier) - Android push:
google-services.jsonmatches your package name - iOS push: entitlements, App Group, team ID and an Apple Development signing certificate
When
PushEnabledistrue, missing push setup is reported as a failure. When it'sfalse, push items are skipped or shown as warnings. Add--require-pushto fail on missing push setup even when push is off.
It's safe to re-run any time you change ConnectConfig.json.
npx acoustic-connect doctorWarnings 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.
- Add the
<Connect>wrapper to your app's root component. It tracks screen changes for you.
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>
)
}- Build and run your app.
npx expo run:iosnpx expo run:androidVerify 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.
Use the app for a minute: switch screens and tap a few controls. The SDK sends nothing until something happens in the app.
- iOS: each successful post logs
Posting : …/collector/collectorPostin the Xcode console, followed by a response withStatus Code: 200. The SDK also sends any queued data when the app goes to the background. - Android: look for
Http status: 200 from url: …/collector/collectorPostunder theEOCoretag in Logcat, about every 30 seconds.
A new session may take some time to appear in Connect.
Enable debug logging
With "useRelease": false (the default), verbose native logging is on automatically and appears in the Xcode console. You don't need to add anything to your Xcode scheme. Setting useRelease to true for production turns it off; see Move to production.
To read the logs outside Xcode, open Console.app, select the simulator or device, and filter by your app's name.
Verbose logging is on by default - no equivalent setup step needed. Filter Logcat by the tags AcousticConnectRN and EOCore to isolate SDK output.
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
npm install peer-dependency conflict on react-native-nitro-modulesThe SDK pins react-native-nitro-modules to an exact version, so npm install fails with ERESOLVE if your project resolves a different one. Install the exact version the error names, together with the SDK, as shown in step 1. Check the resolved version with npm ls react-native-nitro-modules.
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
npm installThe 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.mjsnpx expo run:ios fails after cannot load such file -- kconv
npx expo run:ios fails after cannot load such file -- kconvRuby 3.4 and later no longer include the nkf gem by default, and CocoaPods still needs it. npx expo run:ios runs pod install for you, so the error appears partway through the build; the build carries on and usually stops later with an error that looks unrelated. Scroll up to check for kconv.
To fix it:
- If your project has a Gemfile: add
gem 'nkf'to it, then runbundle installfrom your project root. - If it doesn't: run
gem install nkf.
Then run npx expo run:ios again.
Connect: navigation tracking disabled - no usable NavigationContainer ref resolved
Connect: navigation tracking disabled - no usable NavigationContainer ref resolvedThis warning may appear at startup when NavigationContainer is nested inside other providers rather than being a direct child of <Connect>. Screen tracking works correctly despite the warning - it does not indicate a loss of functionality.
xcodebuild requires Xcode, but the active developer directory is a command line tools instance
xcodebuild requires Xcode, but the active developer directory is a command line tools instanceThe command line is using the Command Line Tools instead of Xcode. Point it at Xcode:
sudo xcode-select -s /Applications/Xcode.app/Contents/DeveloperIf you don't have admin rights, add this line to your shell profile (for example ~/.zshrc) instead, then open a new terminal:
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/DeveloperGradle fails to resolve io.github.go-acoustic:connect
io.github.go-acoustic:connectThe SDK requires an Android Connect artifact in the range [11.0.11, 12.0.0). If Gradle rejects your pinned version, set "AndroidVersion" in ConnectConfig.json to an empty string and re-sync.
Gradle cannot find node or npx
node or npxThis occurs when Gradle is launched outside a shell where your Node installation is active - most commonly when Android Studio is opened from the Dock rather than from a terminal.
Recommended fix: Open Android Studio from a terminal so it inherits your shell's PATH:
open -a "Android Studio"SDK initializes but no session appears in Connect
The kill switch may be returning "die". Check the native log for KillSwitch Responded with 0 and killswitch : says die. The most likely cause is that PostMessageUrl points to a different collector node than the one where your app is registered. Verify the collector URL in your Connect account and update PostMessageUrl in ConnectConfig.json, then run expo prebuild again and rebuild.
Config changes don't take effect after editing ConnectConfig.json
ConnectConfig.json is baked into the native build at prebuild time. A Metro reload is not enough - run npx expo prebuild --clean and rebuild.
Next steps
- Identify users at registration - send the account registered signal to associate sessions with contacts in Connect.
- Identify users at sign-in - send the logged in signal to attribute sessions to known contacts.
- Enable push notifications - configure APNs (iOS) and FCM (Android) using the bundled Config Plugin.
- Connect React Native SDK public API reference - full method signatures and event types.
Updated 12 days ago
