sentry-react-sdk

Automate Sentry integration for React apps with error monitoring and tracing.

Updated Jul 4, 2021
One-click install
npx skills add https://github.com/Valor-mmm/time-calculator --skill sentry-react-sdk-valor-mmm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sentry-react-sdk
Source: https://github.com/Valor-mmm/time-calculator/tree/main/.agents/skills/sentry-react-sdk
Command: npx skills add https://github.com/Valor-mmm/time-calculator --skill sentry-react-sdk-valor-mmm

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

The Sentry React SDK provides an end-to-end setup workflow for enabling error monitoring, performance tracing, session replay, and optional observability features in React applications.

Core Features & Use Cases

  • Error Monitoring for React components and boundaries
  • Tracing of page loads, navigations, and API calls
  • Session Replay to reproduce user experiences
  • Optional Logging and Profiling integrations with @sentry/react
  • Compatibility with React Router, TanStack Router, Redux, and source maps for readable stack traces
  • Build-tool and environment integrations for Vite, CRA, Webpack, and bundlers

Quick Start

Install and initialize the Sentry React SDK in your app, then enable the desired integrations and render your app.

Frequently Asked Questions about sentry-react-sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up Sentry error monitoring and performance tracing in a React app?

Sentry error monitoring and tracing in a React app requires initializing the SDK with a DSN and enabling browserTracing. You can automate this end-to-end setup across typical frontend stacks to capture component errors and page navigations.

Does Sentry React SDK work with React Router and TanStack Router for navigation tracing?

Yes, Sentry React SDK supports navigation tracing with both React Router and TanStack Router. It automatically instruments page loads and navigations to provide performance insights across your application's routing structure.

Can I use Sentry session replay with Redux state management in React?

Sentry session replay works alongside Redux state management in React applications. You can enable replay during SDK initialization to visually reproduce user experiences while monitoring state-driven component errors.

What's the best way to configure source maps for readable Sentry stack traces in Vite or Webpack?

Configuring source maps for Sentry stack traces involves integrating build-tool settings for Vite, CRA, or Webpack. This setup ensures your error monitoring reports readable, unminified stack traces from your React production builds.

Why do I need a DSN and @sentry/react installed before enabling session replay?

A DSN and the @sentry/react package are required because the DSN routes error monitoring data to your Sentry project while the package provides the browserTracing and replay integrations needed for session capture.

What optional logging and profiling integrations can I enable with Sentry React SDK?

Optional logging and profiling integrations can be enabled through the Sentry init configuration alongside browserTracing and replay. These features extend error monitoring to capture deeper performance insights within your React application.