PricingBlogDocumentationDocsLoginRegister

Connect your React-Native project to GlitchTip

Installation

Start by adding the SDK and then linking it:

$ npm install --save @sentry/react-native
# or
# yarn add @sentry/react-native
# if you are using yarn
# If you are running a project with react-native prior to 0.60, you still need to call react-native link, otherwise you can skip this step as react-native
# version 0.60 and above does this automatically.
# this is for linking
$ react-native link @sentry/react-native

The link step will pull in the native dependency and patch your project 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 MainApplication.java for Android
  • configure the SDK for the supplied DSN in your index.js/App.js files
  • store build credentials in ios/sentry.properties and android/sentry.properties.

Client Configuration

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

import * as Sentry from "@sentry/react-native";
Sentry.init({
  dsn: "YOUR-GLITCHTIP-DSN-HERE",
});

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