Install the sentry React Native SDK:
npm install @sentry/react-native
Initialize the SDK as early as possible (e.g., in index.js or App.js):
import * as Sentry from "@sentry/react-native";
Sentry.init({
dsn: "YOUR_DSN",
tracesSampleRate: 0.01, // 1% of transactions
autoSessionTracking: false, // GlitchTip does not support sessions
});
The SDK captures JavaScript errors, native crashes (iOS and Android), and unhandled promise rejections.
Verify your setup:
Sentry.captureException(new Error("Test GlitchTip error!"));
Upload native debug symbols for readable crash stack traces using the GlitchTip CLI:
glitchtip-cli debug-files upload ./ios/build --org my-org --project my-project
tracesSampleRate to a low value. Mobile apps can generate many transactions.