React Native

This is the documentation for our React Native SDK. The React Native SDK uses a native extension for iOS and Android but will fall back to a pure JavaScript version if necessary.

Getting Started

Getting started with Sentry is a three step process:

  1. Sign up for an account
  2. Install your SDK
  3. Configure it


Start by adding Sentry and then linking it:

npm install react-native-sentry --save
# or
# yarn add react-native-sentry
# if you are using yarn
# this is for linking
react-native link react-native-sentry

The link step will pull in the native dependency and patch your

projectRepresents your service in Sentry and allows you to scope events to a distinct application.
accordingly. If you are using expo you don’t have to (or can’t) run that link step. For more information about that see Using Sentry with Expo.

On linking the new Sentry Wizard will help you to configure your project and change files accordingly.

Upon linking the following changes will be performed:

  • add the sentry-java package for native crash reporting on Android
  • add the sentry-cocoa package for native crash reporting on iOS
  • enable the Sentry gradle build step for android
  • patch AppDelegate.m for iOS
  • patch for Android
  • configure Sentry for the supplied
    DSNThe Data Source Name (DSN) key tells the Sentry SDK where to send events, ensuring they go to the right project.
    in your index.js/App.js files
  • store build credentials in ios/ and android/

To see what is happening during linking you can refer to Manual Setup which will give you all the details.

Note that we only support react-native >= 0.38 at the moment.


If you are upgrading from an earlier version of sentry-react-native you should re-link the package to ensure the generated code is updated to the latest version:

react-native unlink react-native-sentry
react-native link react-native-sentry

iOS Specifics

When you use Xcode you can hook directly into the build process to upload debug symbols and source maps. If you however are using bitcode you will need to disable the “Upload Debug Symbols to Sentry” build phase and then separately upload debug symbols from iTunes Connect to Sentry.

Android Specifics

For Android we hook into gradle for the source map build process. When you run react-native link the gradle files are automatically updated. When you run ./gradlew assembleRelease source maps are automatically built and uploaded to Sentry.

Client Configuration

When you run react-native link we will automatically update your index.ios.js / with the following changes:

import { Sentry } from "react-native-sentry";

You can pass additional configuration options to the config() method if you want to do so.

Mixed Stack Traces

Currently we only support mixed stack traces on iOS. By default this feature is disabled. We recommend testing your app thoroughly when activating this, to turn it on deactivateStacktraceMerging: false see: Additional Configuration.

Deep Dive

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) to suggesting an update ("yeah, this would be better").