Migrate from LogRocket

This guide is for React Native and Expo teams that use the LogRocket React Native SDK, @logrocket/react-native, and want to move to Vexo.

To switch, you replace the LogRocket package, and its Expo config plugin if you use one, with vexo-analytics, and call vexo() once with your API key. Vexo then records sessions, screens, taps, errors, network requests, and session replays without more code, so most LogRocket calls map to one Vexo call or go away.

Before you begin

  • Create a Vexo account and an app, and copy the app's API key.
  • Use React Native 0.74 or later, and set your app's minimum iOS deployment target to 15.1 or later.

Swap the SDK

  1. Uninstall the LogRocket package and install vexo-analytics.

    With Expo:

    npm uninstall @logrocket/react-native
    npx expo install vexo-analytics
    

    With bare React Native:

    npm uninstall @logrocket/react-native
    npm install vexo-analytics
    cd ios && pod install
    
  2. In your entry file, replace the LogRocket setup with a vexo() call. Call it at module scope, outside any component or useEffect, so tracking starts when the app starts. With Expo Router, the entry file is the root layout, app/_layout.tsx.

    -import LogRocket from '@logrocket/react-native';
    +import { vexo } from 'vexo-analytics';
    +
    +vexo('YOUR_API_KEY');
    
     const App = () => {
    -  useEffect(() => {
    -    LogRocket.init('<APP_SLUG>');
    -  }, []);
       // Your application entry
     };
    
  3. With Expo, remove the LogRocket config plugin from app.json (or app.config.js). If you installed expo-build-properties only for LogRocket, you can remove it and its entry too.

     "plugins": [
    -  "@logrocket/react-native"
     ]
    

    With bare React Native, remove LogRocket's Maven repository, https://storage.googleapis.com/logrocket-maven/, from android/build.gradle.

  4. Replace or delete the other LogRocket calls in your app, including LogRocket's Redux middleware, which has no Vexo equivalent. Use the API mapping to find each replacement.

  5. Rebuild the app, because vexo-analytics includes native code. A JavaScript reload or an over-the-air update isn't enough. For the commands, see the Quickstart.

Expo: Vexo runs in a development build or an EAS Build. It doesn't run in Expo Go, because it needs custom native code. Unlike LogRocket, Vexo doesn't need a config plugin. On Expo SDK 58, use vexo-analytics 1.14.0 or later. See Upgrading to Expo SDK 58.

API mapping

TaskLogRocketVexo
InitializeLogRocket.init('<APP_SLUG>')vexo('YOUR_API_KEY')
Identify the userLogRocket.identify(uid)identifyDevice(id). To make the device anonymous again, for example when the user signs out, call identifyDevice(null).
User traitsLogRocket.identify(uid, { name, email })No SDK call: identifyDevice takes only an ID. Send traits from your backend with an identify.
Custom event with propertiesLogRocket.track(name, properties)customEvent(name, properties). Pass {} when the event has no properties.
Screen trackingAutomatic for each iOS view controller and Android activity. LogRocket.tagPage(name) tags a page within one.Automatic for each route with React Navigation and Expo Router. For other navigation, call trackScreen(name) on each screen change.
Global event propertiesNo documented callregisterProperties({ name: value }) adds the properties to every event in the session. A property of the same name in a customEvent call wins.
Report a caught errorLogRocket.captureException(err)trackError(err)
Stop recording or opt outshutdown() ends the sessiondisableTracking() stops events and recording, and the choice persists across launches. enableTracking() turns tracking back on.
Session replay controlsLogRocket.pauseViewCapture() and LogRocket.unpauseViewCapture()No pause call. vexo('YOUR_API_KEY', { sessionReplay: false }) turns replay off on the device. { sessionReplaySampleRate: 0.1 } records about 10% of sessions.
Masking and privacy<LRRedact> and LRRedactProps() around a view, redactionTags in init, and textSanitizer: 'excluded' for all textEvery replay frame is blurred on the device by default. No published release masks individual views yet.

What changes

  • Masking is whole-frame. Vexo blurs every frame of a replay on the device before it's uploaded, with the Blur session replays setting, which is on by default. No published release of vexo-analytics masks individual views yet: VexoMask, VexoUnmask, and the masking option of vexo() are in the API, but they don't hide anything. Keep blur on if your app shows sensitive content.
  • Crash reporting covers JavaScript. Vexo reports JavaScript errors and crashes, and records JavaScript-thread stalls in the session timeline. It doesn't capture native crashes. To see native crashes in Vexo, import them from Firebase Crashlytics. See Crashes and handled errors.
  • Stack traces use source maps. Instead of LogRocket's debug file upload, upload your JavaScript source maps with npx vexo-upload-sourcemaps. See Source maps.
  • Network capture is summary-level. For each request, Vexo records the URL, status code, and latency, but not headers or bodies. See Network Stats.
  • Pricing is published. See Vexo pricing.

Move your data

Your LogRocket sessions, events, and users don't move to Vexo, and Vexo can't import them. Your Vexo history starts when the first build with vexo-analytics reaches your users.

To compare both tools before you remove LogRocket, you can run both SDKs for a short cutover window: add vexo-analytics and the vexo() call next to your LogRocket setup, and then remove LogRocket in a later release. Vexo uses its own native modules, and it passes JavaScript errors on to any error handler that was installed before it. Both SDKs record the screen, though, so test the pair in a development build before you ship it.