getsentry/sentry-react-native-sdk

Configuration complète du SDK Sentry pour React Native et Expo. Utilisez cette compétence lorsqu'on vous demande d'« ajouter Sentry à React Native », d'« installer @sentry/react-native », de « configurer Sentry dans Expo » ou de paramétrer la surveillance des erreurs, le tracing, le profilage, le rejeu de session ou la journalisation pour les applications React Native. Prend en charge Expo managed, Expo bare et React Native vanilla.

Qu'est-ce que sentry-react-native-sdk ?

Cette compétence automatise l'intégration complète du SDK Sentry (sentry/react-native) dans les projets React Native et Expo. Elle est conçue pour les développeurs utilisant des agents d'IA comme Claude Code ou Cursor, et leur permet d'installer et de configurer rapidement @sentry/react-native en réponse à des requêtes telles que « ajouter Sentry à React Native », « installer @sentry/react-native », ou « configurer Sentry dans Expo ». La compétence gère les trois types de projets : Expo managed, Expo bare, et React Native vanilla. Elle configure les fonctionnalités clés de Sentry : la surveillance des erreurs (error monitoring), le tracing des performances (tracing), le profilage (profiling), le rejeu de session (session replay), et la journalisation (logging). En automatisant des étapes comme l'exécution de npx @sentry/wizard, la configuration du fichier App.tsx ou App.js, et la définition des variables d'environnement dans app.json pour Expo, cette compétence réduit considérablement le temps et les erreurs manuelles, offrant une configuration de bout en bout fiable et documentée.

Compatible avec~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/getsentry/sentry-for-ai/tree/main/skills/sentry-react-native-sdk

Installed? Explore more Développement et programmation skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Demander à votre IA préférée

Ouvre une nouvelle conversation avec cette compétence d'agent déjà préchargée.

Documentation

Que fait sentry-react-native-sdk ?

Configuration complète du SDK Sentry pour React Native et Expo. Utilisez cette compétence lorsqu'on vous demande d'« ajouter Sentry à React Native », d'« installer @sentry/react-native », de « configurer Sentry dans Expo » ou de paramétrer la surveillance des erreurs, le tracing, le profilage, le rejeu de session ou la journalisation pour les applications React Native. Prend en charge Expo managed, Expo bare et React Native vanilla.

Installation

Exécutez la commande suivante pour installer le package Sentry :

npx @sentry/wizard -i reactNative

Pour Expo (managed)

Après avoir exécuté le wizard, suivez les instructions supplémentaires pour Expo :

  1. Mettez à jour app.json :
{
  "expo": {
    "plugins": [
      "@sentry/react-native/expo"
    ]
  }
}
  1. Configurez les variables d'environnement (par exemple, dans un fichier .env ou directement dans app.json) :
SENTRY_DSN=https://[email protected]/0

Configuration

Ouvrez votre fichier d'entrée principal (généralement App.tsx ou App.js) et ajoutez :

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

Sentry.init({
  dsn: 'https://[email protected]/0',
  tracesSampleRate: 1.0, // Ajustez en production
  profilesSampleRate: 1.0, // Pour le profilage
  replaysSessionSampleRate: 0.1, // Rejeu de session (session replay)
  replaysOnErrorSampleRate: 1.0,
  enableNative: true,
  enableAutoPerformanceTracing: true,
});

Surveillance des performances avec des traces

Pour capturer des transactions personnalisées, utilisez Sentry.startTransaction :

const transaction = Sentry.startTransaction({ name: 'example-transaction' });
const span = transaction.startChild({ op: 'task' });
// ... votre code ...
span.finish();
transaction.finish();

Rejeu de session (Session Replay)

Actif par défaut si le taux d'échantillonnage est configuré. Pour l'arrêter, définissez replaysSessionSampleRate à 0.

Utilisation

Cette compétence répond aux demandes suivantes :

  • « Ajoute Sentry à mon projet React Native »
  • « Installe @sentry/react-native »
  • « Configure la surveillance des erreurs avec Sentry dans mon application React Native »
  • « Active le tracing des performances dans mon application React Native »
  • « Configure le rejeu de session Sentry dans Expo »
  • « Mets en place le profilage avec Sentry dans mon application React Native »

Dépannage

  • Erreur de compilation native : Assurez-vous que @sentry/react-native est correctement lié. Pour Expo managed, vérifiez que le plugin @sentry/react-native/expo est dans app.json.
  • Pas de traces : Vérifiez que tracesSampleRate est supérieur à 0 et que l'option enableAutoPerformanceTracing est activée.
  • Rejeu de session non fonctionnel : Confirmez que replaysSessionSampleRate est défini (par exemple, 0.1).

Références

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

getsentry/sentry-android-sdk

Full Sentry SDK setup for Android. Use when asked to "add Sentry to Android", "install sentry-android", "setup Sentry in Android", or configure error monitoring, tracing, profiling, session replay, or logging for Android applications. Supports Kotlin and Java codebases.

getsentry/sentry-browser-sdk

Full Sentry SDK setup for browser JavaScript. Use when asked to "add Sentry to a website", "install @sentry/browser", or configure error monitoring, tracing, session replay, or logging for vanilla JavaScript, jQuery, static sites, or WordPress.

getsentry/sentry-cloudflare-sdk

Full Sentry SDK setup for Cloudflare Workers and Pages. Use when asked to "add Sentry to Cloudflare Workers", "install @sentry/cloudflare", or configure error monitoring, tracing, logging, crons, or AI monitoring for Cloudflare Workers, Pages, Durable Objects, Queues, Workflows, or Hono on Cloudflare.

getsentry/sentry-cocoa-sdk

Full Sentry SDK setup for Apple platforms (iOS, macOS, tvOS, watchOS, visionOS). Use when asked to "add Sentry to iOS", "add Sentry to Swift", "install sentry-cocoa", or configure error monitoring, tracing, profiling, session replay, logging, or metrics for Apple applications. Supports SwiftUI and UIKit.

getsentry/sentry-code-review

Analyze and resolve Sentry comments on GitHub Pull Requests. Use this when asked to review or fix issues identified by Sentry in PR comments. Can review specific PRs by number or automatically find recent PRs with Sentry feedback.

getsentry/sentry-create-alert

Create Sentry alerts using the workflow engine API. Use when asked to create alerts, set up notifications, configure issue priority alerts, or build workflow automations. Supports email, Slack, PagerDuty, Discord, and other notification actions.

getsentry/sentry-dotnet-sdk

Full Sentry SDK setup for .NET. Use when asked to "add Sentry to .NET", "install Sentry for C#", or configure error monitoring, tracing, profiling, logging, or crons for ASP.NET Core, MAUI, WPF, WinForms, Blazor, Azure Functions, or any other .NET application.

getsentry/sentry-elixir-sdk

Full Sentry SDK setup for Elixir. Use when asked to "add Sentry to Elixir", "install sentry for Elixir", or configure error monitoring, tracing, logging, or crons for Elixir, Phoenix, or Plug applications. Supports Phoenix, Plug, LiveView, Oban, and Quantum.

getsentry/sentry-feature-setup

Configure specific Sentry features beyond basic SDK setup. Use when asked to monitor AI/LLM calls, set up OpenTelemetry pipelines, create alerts and notifications, or enable span streaming.

getsentry/sentry-fix-issues

Find and fix issues from Sentry using MCP. Use when asked to fix Sentry errors, debug production issues, investigate exceptions, or resolve bugs reported in Sentry. Methodically analyzes stack traces, breadcrumbs, traces, and context to identify root causes.

getsentry/sentry-flutter-sdk

Full Sentry SDK setup for Flutter and Dart. Use when asked to "add Sentry to Flutter", "install sentry_flutter", "setup Sentry in Dart", or configure error monitoring, tracing, profiling, session replay, or logging for Flutter applications. Supports Android, iOS, macOS, Linux, Windows, and Web.

getsentry/sentry-go-sdk

Full Sentry SDK setup for Go. Use when asked to "add Sentry to Go", "install sentry-go", "setup Sentry in Go", or configure error monitoring, tracing, logging, metrics, or crons for Go applications. Supports net/http, Gin, Echo, Fiber, FastHTTP, Iris, Negroni, and gRPC.

getsentry/sentry-nestjs-sdk

Full Sentry SDK setup for NestJS. Use when asked to "add Sentry to NestJS", "install @sentry/nestjs", "setup Sentry in NestJS", or configure error monitoring, tracing, profiling, logging, metrics, crons, or AI monitoring for NestJS applications. Supports Express and Fastify adapters, GraphQL, microservices, WebSockets, and background jobs.

getsentry/sentry-nextjs-sdk

Full Sentry SDK setup for Next.js. Use when asked to "add Sentry to Next.js", "install @sentry/nextjs", or configure error monitoring, tracing, session replay, logging, profiling, AI monitoring, or crons for Next.js applications. Supports Next.js 13+ with App Router and Pages Router.

getsentry/sentry-node-sdk

Full Sentry SDK setup for Node.js, Bun, and Deno. Use when asked to "add Sentry to Node.js", "add Sentry to Bun", "add Sentry to Deno", "install @sentry/node", "@sentry/bun", or "@sentry/deno", or configure error monitoring, tracing, logging, profiling, metrics, crons, or AI monitoring for server-side JavaScript/TypeScript runtimes.

getsentry/sentry-otel-exporter-setup

Configure the OpenTelemetry Collector with Sentry Exporter for multi-project routing and automatic project creation. Use when setting up OTel with Sentry, configuring collector pipelines for traces and logs, or routing telemetry from multiple services to Sentry projects.

getsentry/sentry-php-sdk

Full Sentry SDK setup for PHP. Use when asked to "add Sentry to PHP", "install sentry/sentry", "setup Sentry in PHP", or configure error monitoring, tracing, profiling, logging, metrics, or crons for PHP applications. Supports plain PHP, Laravel, and Symfony.

getsentry/sentry-pr-code-review

Review a project's PRs to check for issues detected in code review by Seer Bug Prediction. Use when asked to review or fix issues identified by Sentry in PR comments, or to find recent PRs with Sentry feedback.

getsentry/sentry-python-sdk

Full Sentry SDK setup for Python. Use when asked to "add Sentry to Python", "install sentry-sdk", "setup Sentry in Python", or configure error monitoring, tracing, profiling, logging, metrics, crons, or AI monitoring for Python applications. Supports Django, Flask, FastAPI, Celery, Starlette, AIOHTTP, Tornado, and more.

getsentry/sentry-react-sdk

Full Sentry SDK setup for React. Use when asked to "add Sentry to React", "install @sentry/react", or configure error monitoring, tracing, session replay, profiling, or logging for React applications. Supports React 16+, React Router v5-v7 non-framework mode, TanStack Router, Redux, Vite, and webpack.

Skills associés