Configure React Native SDK

Getting started is easy:

  1. Visit https://app.logrocket.com to get an app ID.
  2. Initialize the SDK in your application to start recording sessions
    1. You only need to initialize the SDK once using our React Native SDK. There’s no need to separately initialize the iOS or Android native SDKs
    2. If you use Expo, follow these initialization steps
  3. Sanitize your data before sending it to LogRocket. Control what gets captured by filtering out any UI elements, text, or network data you don't want to include

After you finish setup, we recommend the following to enhance your sessions further:

  1. Identify users in LogRocket for easier search and enhanced analytics
  2. Upload sourcemaps for full stack trace visibility
  3. If you use WebViews in your app, follow these steps to capture them in session replay
  4. Tag key pages for precise navigation analytics
    1. LogRocket automatically captures View Controller (iOS) and Activity (Android) events for navigation tracking. However, you can enhance this by adding custom page tags to refine and optimize your navigation analytics further.
  5. Upload your custom fonts on release builds
    1. If you use custom fonts, and notice missing icons or incorrectly sized text in Session Replay, you may want to upload your fonts to LogRocket. This will enable custom fonts to display in session replay.
    2. Follow the setup instructions for both iOS and Android to configure custom fonts on each platform.
    3. Support for uploading custom fonts via Expo is coming soon
  6. Enhance session recordings by setting custom events
    1. While LogRocket automatically captures standard events like clicks and navigation, you can enrich your data by defining custom events for specific business logic or unique interactions that you want to track.
  7. Manually log additional errors and exceptions

Not seeing what you're looking for? Check out the rest of our React Native documentation for even more granular controls.

📘

React Native New Architecture

The LogRocket React Native SDK supports React Native's New Architecture (the default as of React Native 0.76) as of version 1.46.4. For apps that use the LogRocket React Native SDK's view redaction features and are transitioning to the New Architecture, we recommend reviewing the redaction documentation for important changes that may be necessary as part of your transition.