
Sentry React Native Sdk
Instrument React Native apps so JS, iOS, and Android errors and crashes reach Sentry before users churn silently.
Overview
Sentry React Native SDK is an agent skill most often used in Ship (also Operate) that configures error monitoring and crash reporting across JS and native React Native layers.
Install
npx skills add https://github.com/getsentry/sentry-for-ai --skill sentry-react-native-sdkWhat is this skill?
- Unified capture across JavaScript, native iOS (sentry-cocoa), and Android Java/NDK layers
- Documents Sentry.wrap(App), ErrorBoundary, ANR/app-hang detection, and unhandled promise rejection handling
- Scope APIs: tags, user, breadcrumbs, beforeSend/beforeSendTransaction, fingerprinting, Redux integration
- Attachments guidance for screenshots and view hierarchy on crash events
- 13 documented topic sections from capture APIs through Redux integration
- Minimum @sentry/react-native ≥ 6.0.0 (≥ 8.0.0 recommended)
- React Native 0.71+ required for Fabric renderer support
Adoption & trust: 2.5k installs on skills.sh; 197 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your React Native app crashes on real devices but you only see opaque JS errors with no native context or grouped release signal.
Who is it for?
Indie mobile developers preparing App Store or Play builds who want Sentry-native patterns instead of copying fragmented blog snippets.
Skip if: Web-only React projects, backends without a RN client, or teams that refuse client-side error reporting for privacy reasons.
When should I use this skill?
User implements or debugs Sentry error monitoring, crash reporting, or enrichment in a React Native app.
What do I get? / Deliverables
After following the skill, Sentry captures cross-layer crashes, rejections, and enriched events you can triage by release and fingerprint.
- Initialized Sentry RN SDK configuration
- Documented error boundary and native crash capture setup
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Shipping a mobile app without crash reporting is a launch risk; this skill sits on the critical path before store release. Launch subphase covers production-ready observability hooks—not just feature freeze.
Where it fits
Wire Sentry.wrap and native SDK init before submitting the first production build to the stores.
Adjust fingerprinting and beforeSend after a spike in Android NDK crashes on a specific OS version.
Add ErrorBoundary and Redux integration while implementing the main navigation shell.
Enable ANR and app-hang detection to separate slow UI from true crashes in launch week.
How it compares
Use as procedural SDK wiring guidance, not as a substitute for Sentry’s hosted dashboard or server-side logging.
Common Questions / FAQ
Who is sentry-react-native-sdk for?
React Native developers and agent-assisted implementers integrating Sentry before and after mobile production launch.
When should I use sentry-react-native-sdk?
In Ship when adding crash reporting before release; in Operate when tuning beforeSend, breadcrumbs, or Redux context after incidents; during build when scaffolding a new RN app with monitoring day one.
Is sentry-react-native-sdk safe to install?
It instructs sending telemetry to Sentry—scrub PII in hooks and review the Security Audits panel on this page before enabling full session capture.
SKILL.md
READMESKILL.md - Sentry React Native Sdk
# Error Monitoring & Crash Reporting — Sentry React Native SDK > **Minimum SDK:** `@sentry/react-native` ≥ 6.0.0 (≥ 8.0.0 recommended) > **Native SDKs:** `sentry-cocoa` (iOS/tvOS/macOS) · `sentry-android` (Java + NDK) > **React Native:** 0.71+ required for Fabric renderer support React Native is unique: errors can originate from three different layers — the **JavaScript runtime**, **native iOS** (ObjC/Swift, Mach exceptions), or **native Android** (Java, JNI/C++ via NDK). The Sentry RN SDK bridges all three. --- ## Table of Contents 1. [Core Capture APIs](#1-core-capture-apis) 2. [Native Crash Handling — iOS & Android](#2-native-crash-handling--ios--android) 3. [ANR / App Hang Detection](#3-anr--app-hang-detection) 4. [Unhandled Promise Rejections](#4-unhandled-promise-rejections) 5. [Sentry.wrap(App) — Top-Level Error Boundary](#5-sentrywrapapp--top-level-error-boundary) 6. [ErrorBoundary Component](#6-errorboundary-component) 7. [Scope Management](#7-scope-management) 8. [Context Enrichment — Tags, User, Extra, Contexts](#8-context-enrichment--tags-user-extra-contexts) 9. [Breadcrumbs — Automatic & Manual](#9-breadcrumbs--automatic--manual) 10. [beforeSend / beforeSendTransaction Hooks](#10-beforesend--beforesendtransaction-hooks) 11. [Fingerprinting & Grouping](#11-fingerprinting--grouping) 12. [Event Processors](#12-event-processors) 13. [Attachments — Screenshots & View Hierarchy](#13-attachments--screenshots--view-hierarchy) 14. [Redux Integration](#14-redux-integration) 15. [Device & App Context](#15-device--app-context) 16. [Release Health & Sessions](#16-release-health--sessions) 17. [Offline Event Caching](#17-offline-event-caching) 18. [Default Integrations](#18-default-integrations) 19. [Full init() Options Reference](#19-full-init-options-reference) 20. [Quick Reference Cheatsheet](#20-quick-reference-cheatsheet) 21. [Troubleshooting](#21-troubleshooting) --- ## 1. Core Capture APIs Three fundamental data concepts: - **Event** — a single submission to Sentry (exception, message, or raw event) - **Issue** — a group of similar events clustered by Sentry - **Capturing** — the act of reporting an event ### `Sentry.captureException(error, context?)` Captures any thrown `Error` (or non-Error value) and sends it to Sentry. ```typescript import * as Sentry from "@sentry/react-native"; // Basic usage try { aFunctionThatMightFail(); } catch (err) { Sentry.captureException(err); } // With inline context (plain object) Sentry.captureException(new Error("something went wrong"), { tags: { section: "checkout" }, user: { email: "user@example.com" }, extra: { orderId: "abc-123" }, level: "warning", fingerprint: ["{{ default }}", "checkout-error"], }); // With a scope callback — clones scope for this capture only Sentry.captureException(new Error("something went wrong"), (scope) => { scope.setTag("section", "articles"); scope.setLevel("warning"); return scope; }); // New Scope instance — merges with global scope const scope = new Sentry.Scope(); scope.setTag("section", "articles"); Sentry.captureException(new Error("something went wrong"), scope); // Isolate entirely — return the scope from a function to ignore global attrs Sentry.captureException(new Error("clean slate"), () => scope); ``` ### `Sentry.captureMessage(message, level?)` Sends a textual message. Useful for non-exception events or informational milestones. ```typescript // Default level is "info" Sentry.captureMessage("Something noteworthy happened"); // Explicit severity level // "fatal" | "error" | "warning" | "log" | "info" | "debug" Sentry.captureMessage("Payment declined", "warning"); Sentry.captureMessage("Critical system failure", "fatal"); Sentry.captureMessage("Debug checkpoint reached", "debug"); ``` ### `Sentry.captureEvent(event)` Low-level method to send a fully constructed Sentry event object. Used for advanced cases where you build the event manually. ```typescript Sentry.captureEvent({ message: "Manual event"