MCPcopy
hub / github.com/getsentry/sentry-react-native

github.com/getsentry/sentry-react-native @8.17.1 sqlite

repository ↗ · DeepWiki ↗ · release 8.17.1 ↗
1,873 symbols 5,039 edges 513 files 179 documented · 10%
README
<a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
    <img src="https://sentry-brand.storage.googleapis.com/github-banners/github-sdk-react.jpg" alt="Sentry for React Native">
</a>

Bad software is everywhere, and we're tired of it. Sentry is on a mission to help developers write better software faster, so we can get back to enjoying technology. If you want to join us Check out our open positions

Sentry SDK for React Native

Build & Test npm version npm dm npm dt X Follow Discord Chat Runs with Expo

Releases

This repo uses the following ways to release SDK updates:

  • Pre-release: We create pre-releases (alpha, beta, RC,…) for larger and potentially more impactful changes, such as new features or major versions.
  • Latest: We continuously release major/minor/hotfix versions from the main branch. These releases go through all our internal quality gates and are very safe to use and intended to be the default for most teams.
  • Stable: We promote releases from Latest when they have been used in the field for some time and in scale, considering time since release, adoption, and other quality and stability metrics. These releases will be indicated on the releases page with the Stable suffix.

For a list of which SDK versions are bundled with each release, see SDK-VERSIONS.md.

Requirements

  • react-native >= 0.65.0

Features

  • Automatic JS Error Tracking (using @sentry/browser)
  • Automatic Native Crash Error Tracking (using sentry-cocoa & sentry-android under the hood)
  • Offline storage of events
  • On Device symbolication for JS (in Debug)
  • Autolinking
  • Events with enriched device data
  • RAM bundle support
  • Hermes support
  • Expo support
  • RN New Architecture support

Installation and Usage

To install the package and setup your project:

npx @sentry/wizard -s -i reactNative

How to use it:

import * as Sentry from "@sentry/react-native";

Sentry.init({
  dsn: "__DSN__",

  // Set tracesSampleRate to 1.0 to capture 100%
  // of transactions for performance monitoring.
  // We recommend adjusting this value in production
  tracesSampleRate: 1.0,
});

Sentry.setTag("myTag", "tag-value");
Sentry.setExtra("myExtra", "extra-value");
Sentry.addBreadcrumb({ message: "test" });

Sentry.captureMessage("Hello Sentry!");

Upgrade

If you are coming from react-native-sentry which was our SDK < 1.0 you should follow the upgrade guide and then follow the install steps.

Blog posts

Introducing Mobile Screenshots and Suspect Commits.

Tips for Optimizing React Native Application Performance - Part 2: Using Sentry SDK for Performance Monitoring.

Tips for Optimizing React Native Application Performance: Part 1.

Tracking Stability in a Bluetooth Low Energy-Based React-Native App.

Mobile Vitals - Four Metrics Every Mobile Developer Should Care About.

Performance Monitoring Support for React Native.

Resources

  • Documentation
  • Discussions
  • Discord Chat
  • Code of Conduct
  • X Follow

Extension points exported contracts — how you extend this code

Package (Interface)
(no doc) [2 implementers]
packages/core/android/expo-stubs/src/main/java/expo/modules/core/interfaces/Package.java
CounterIncrementAction (Interface)
(no doc)
samples/react-native-macos/src/reduxApp.ts
Article (Interface)
(no doc)
samples/react-native/src/types/api.ts
History (Interface)
(no doc)
dev-packages/type-check/ts3.8-test/index.ts
ReactNativeHostHandler (Interface)
(no doc) [2 implementers]
packages/core/android/expo-stubs/src/main/java/expo/modules/core/interfaces/ReactNativeHostHandler.java
CounterResetAction (Interface)
(no doc)
samples/react-native-macos/src/reduxApp.ts
ArticlesResponse (Interface)
(no doc)
samples/react-native/src/types/api.ts
IDBObjectStore (Interface)
(no doc)
dev-packages/type-check/ts3.8-test/index.ts

Core symbols most depended-on inside this repo

log
called by 398
packages/core/android/src/main/java/io/sentry/react/RNSentryLogger.java
flush
called by 138
packages/core/src/js/replay/replayInterface.ts
init
called by 115
packages/core/src/js/sdk.tsx
getDefaultTestClientOptions
called by 88
packages/core/test/mocks/client.ts
get
called by 86
packages/core/src/js/utils/AsyncExpiringMap.ts
init
called by 82
packages/core/src/js/client.ts
clear
called by 80
packages/core/src/js/utils/AsyncExpiringMap.ts
mockFunction
called by 60
packages/core/test/testutils.ts

Shape

Function 1,095
Method 514
Interface 172
Class 92

Languages

TypeScript81%
Java19%

Modules by API surface

packages/core/src/js/wrapper.ts96 symbols
packages/core/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java68 symbols
packages/core/android/src/oldarch/java/io/sentry/react/RNSentryModule.java48 symbols
packages/core/android/src/newarch/java/io/sentry/react/RNSentryModule.java48 symbols
packages/core/src/js/NativeRNSentry.ts43 symbols
packages/core/src/js/tracing/integrations/appStart.ts27 symbols
packages/core/src/js/feedback/FeedbackFormManager.tsx27 symbols
packages/core/src/js/touchevents.tsx25 symbols
packages/core/src/js/tracing/reactnavigation.ts22 symbols
packages/core/src/js/tools/metroconfig.ts20 symbols
packages/core/android/src/test/java/io/sentry/react/RNSentryUriValidationTest.java20 symbols
packages/core/src/js/tracing/reactnativenavigation.ts18 symbols

Dependencies from manifests, versioned

@babel/core7.26.7 · 1×
@babel/preset-env7.22.5 · 1×
@babel/preset-typescript7.18.6 · 1×
@babel/runtime7.22.5 · 1×
@expo/metro-config0.20.0 · 1×
@microsoft/api-extractor7.58.7 · 1×
@mswjs/interceptors0.25.15 · 1×
@naturalcycles/ktlint1.13.0 · 1×
@react-native-community/cli20.1.3 · 1×
@react-native-community/cli-platform-android20.1.3 · 1×
@react-native-community/cli-platform-ios20.1.3 · 1×

For agents

$ claude mcp add sentry-react-native \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact