Community코딩 & 개발github.com

getsentry/sentry-react-sdk

React 애플리케이션을 위한 전체 Sentry SDK 설정. 'React에 Sentry 추가', '@sentry/react 설치' 또는 React 앱의 오류 모니터링, 추적, 세션 재생, 프로파일링, 로깅 구성 요청 시 사용하세요. React 16+, React Router v5-v7 비프레임워크 모드, TanStack Router, Redux, Vite, webpack을 지원합니다.

sentry-react-sdk란 무엇인가요?

이 스킬은 React 애플리케이션에 Sentry SDK를 완전히 설정하는 방법을 제공합니다. 개발자가 오류 모니터링, 성능 추적, 세션 재생, 프로파일링, 로깅을 React 앱에 통합해야 할 때 유용합니다. React 16 이상, React Router v5-v7 비프레임워크 모드, TanStack Router, Redux, Vite, webpack 등 다양한 환경을 지원합니다. SKILL.md 문서는 `@sentry/react` 패키지 설치, 초기화, 플러그인 구성, 배포 환경 설정 등 전체 워크플로우를 안내하며, `npx @sentry/wizard`를 통한 자동 설정, 환경 변수 (`SENTRY_DSN`, `SENTRY_AUTH_TOKEN` 등)를 활용한 구성 예시를 포함합니다. 이 스킬은 Claude Code, Cursor, Codex 같은 AI 에이전트가 React 프로젝트에 Sentry를 신속하고 정확하게 통합하도록 도와줍니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/getsentry/sentry-for-ai/tree/main/skills/sentry-react-sdk

Installed? Explore more 코딩 & 개발 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

sentry-react-sdk은(는) 무엇을 하나요?

React 애플리케이션을 위한 전체 Sentry SDK 설정. 'React에 Sentry 추가', '@sentry/react 설치' 또는 React 앱의 오류 모니터링, 추적, 세션 재생, 프로파일링, 로깅 구성 요청 시 사용하세요. React 16+, React Router v5-v7 비프레임워크 모드, TanStack Router, Redux, Vite, webpack을 지원합니다.

사용법

다음 명령어로 Sentry를 React 프로젝트에 빠르게 추가할 수 있습니다:

npx @sentry/wizard@latest -i react

또는 수동으로 설치하려면:

npm install @sentry/react
# 또는
yarn add @sentry/react

설정 예시

기본 초기화 (main.jsx 또는 index.jsx)

import React from 'react';
import ReactDOM from 'react-dom/client';
import * as Sentry from '@sentry/react';
import App from './App';

Sentry.init({
  dsn: "__SENTRY_DSN__",
  integrations: [
    Sentry.browserTracingIntegration(),
    Sentry.replayIntegration(),
  ],
  // 성능 추적을 위해 트랜잭션 샘플링 비율 설정 (1 = 100%)
  tracesSampleRate: 1.0,
  // 세션 재생 샘플링 비율 (1 = 100%, 프로덕션에서는 낮춤)
  replaysSessionSampleRate: 0.1,
  replaysOnErrorSampleRate: 1.0,
});

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>
);

React Router v6과 통합

import React from 'react';
import * as Sentry from '@sentry/react';
import {
  createBrowserRouter,
  RouterProvider,
} from 'react-router-dom';

const router = createBrowserRouter([
  {
    path: '/',
    element: <Home />,
    errorElement: <Sentry.ErrorBoundary fallback={<ErrorPage />} />,
  },
  {
    path: '/about',
    element: <About />,
  },
]);

function App() {
  return <RouterProvider router={router} />;
}

export default Sentry.withSentryReactRouterV6Routing(App);

TanStack Router 통합

import { createRouter } from '@tanstack/react-router';
import * as Sentry from '@sentry/react';

// Sentry TanStack Router 브라우저 트레이싱 통합
const sentryIntegration = Sentry.tanStackRouterBrowserTracingIntegration(router);

Sentry.init({
  dsn: '__SENTRY_DSN__',
  integrations: [
    sentryIntegration,
    Sentry.replayIntegration(),
  ],
  tracesSampleRate: 1.0,
});

환경 변수

  • SENTRY_DSN: Sentry 프로젝트의 DSN (필수).
  • SENTRY_AUTH_TOKEN: 소스 맵 업로드 등을 위한 인증 토큰 (선택 사항, 배포 시 권장).
  • SENTRY_ORG: Sentry 조직 이름 (선택 사항).
  • SENTRY_PROJECT: Sentry 프로젝트 이름 (선택 사항).

지원 프레임워크 및 도구

  • React: 16.x, 17.x, 18.x, 19.x
  • React Router: v5, v6, v7 (비프레임워크 모드)
  • TanStack Router: 최신 버전
  • Redux: Redux 미들웨어를 통한 상태 추적
  • Vite: Vite 플러그인을 통한 소스 맵 업로드
  • webpack: webpack 플러그인을 통한 소스 맵 업로드

추가 구성

Redux 미들웨어

import * as Sentry from '@sentry/react';
import { createStore, applyMiddleware } from 'redux';

const store = createStore(
  reducer,
  applyMiddleware(Sentry.createReduxMiddleware())
);

세션 재생 구성

Sentry.init({
  dsn: '__SENTRY_DSN__',
  integrations: [
    Sentry.replayIntegration({
      maskAllText: true,
      blockAllMedia: true,
    }),
  ],
  // 세션 재생 샘플링
  replaysSessionSampleRate: 0.1,
  replaysOnErrorSampleRate: 1.0,
});

참고

  • 자세한 내용은 Sentry React 공식 문서를 참고하세요.
  • 배포 시 SENTRY_AUTH_TOKEN을 설정하여 소스 맵을 자동으로 업로드하는 것이 좋습니다.

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-native-sdk

Full Sentry SDK setup for React Native and Expo. Use when asked to "add Sentry to React Native", "install @sentry/react-native", "setup Sentry in Expo", or configure error monitoring, tracing, profiling, session replay, or logging for React Native applications. Supports Expo managed, Expo bare, and vanilla React Native.

관련 스킬