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:
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.