getsentry/sentry-for-ai/sentry-react-router-framework-sdk
Claude Code and agent skill by getsentry/sentry-for-ai
- community
Checking that the SKILL.md file is still in the repository.
Full Sentry SDK setup for React Router Framework mode. Use when asked to "add Sentry to React Router Framework", "install @sentry/react-router", or configure error monitoring, tracing, profiling, session replay, logs, or user feedback for a React Router v7 framework app.
Install
npx vskill@latest install getsentry/sentry-for-ai/sentry-react-router-framework-sdkSKILL.md
The same SKILL.md was published earlier as getsentry/sentry-for-ai/sentry-react-router-framework-sdk.
All Skills > SDK Setup > React Router Framework SDK
Sentry React Router Framework SDK
Opinionated wizard that scans your React Router Framework project and guides you through complete Sentry setup across client and server entry points.
Invoke This Skill When
- User asks to "add Sentry to React Router Framework" or "set up Sentry in React Router v7 framework mode"
- User wants to install or configure
@sentry/react-router - User uses React Router framework entry files (
entry.client.tsx,entry.server.tsx) and wants tracing/error capture - User asks about
reactRouterTracingIntegration,sentryOnError,createSentryHandleRequest, or React Router wizard setup
Important: This SDK is currently beta.For React Router non-framework/data/declarative mode (v5/v6/v7), usesentry-react-sdkwith@sentry/reactintegrations instead.
Phase 1: Detect
Run these commands to understand the project before making any recommendations:
What to determine:
| Question | Impact | |
|---|---|---|
@sentry/react-router already installed? | Skip install and move to feature setup | |
| Framework entry files exposed? | Need npx react-router reveal before manual config | |
Using @sentry/react instead? | This is likely non-framework routing; redirect to sentry-react-sdk | |
react-router.config.ts + Vite config present? | Source map upload and build-end hook setup path | |
NODE_OPTIONS --import available? | Preferred server instrumentation startup path | |
@sentry/profiling-node desired/available? | Enable server profiling integration | |
| Backend directory found? | Trigger Phase 4 cross-link suggestion |
Phase 2: Recommend
Present a concrete recommendation based on what you found. Do not ask open-ended questions — lead with a proposal:
Recommended (core coverage):
- ✅ Error Monitoring — always; captures client and server errors with framework hooks
- ✅ Tracing — recommended baseline in framework apps with client/server request flow
- ✅ Session Replay — recommended for user-facing applications
Optional (enhanced observability):
- ⚡ Profiling — server-side profiling with
@sentry/profiling-node - ⚡ Logs — structured
Sentry.logger.*ingestion and correlation - ⚡ User Feedback — in-app feedback widget/reporting flows
Recommendation logic:
| Feature | Recommend when... | |
|---|---|---|
| Error Monitoring | Always — non-negotiable baseline | |
| Tracing | Usually yes in framework apps; route and request timing is high-value | |
| Session Replay | User-facing product or difficult UX debugging | |
| Profiling | Server performance investigations needed; Node runtime compatibility verified | |
| Logs | Team wants log-search and trace correlation in Sentry | |
| User Feedback | Product/support teams need direct in-app issue reports |
Propose: "I recommend Error Monitoring + Tracing + Session Replay first. Want me to also enable Profiling, Logs, and User Feedback?"
Phase 3: Guide
Option 1: Wizard (Recommended)
You need to run this yourself — the wizard is interactive and may require browser login:```bashnpx @sentry/wizard@latest -i reactRouter```It installs@sentry/react-router, exposes React Router entry files, creates instrumentation files, updates root error handling, configures source map upload, and adds verification examples.Once it finishes, continue at [Verification](#verification).
If the user skips wizard setup, continue with manual setup below.
Option 2: Manual Setup
Install packages
If profiling is needed:
Expose framework entry files
Configure client in entry.client.tsx
Configure server in instrument.server.mjs
Wrap server handlers in entry.server.tsx
For custom server logic, use wrapSentryHandleRequest, getMetaTagTransformer, and manual Sentry.captureException in your custom handleError.
Load server instrumentation on startup
Prefer NODE_OPTIONS --import:
Fallback for platforms where runtime flags are restricted:
This direct-import method can result in incomplete auto-instrumentation compared to --import.
Configure source maps
vite.config.ts:
react-router.config.ts:
For Each Agreed Feature
Walk through features one at a time. Load the reference file, follow steps exactly, and verify before moving on:
| Feature | Reference | Load when... | |
|---|---|---|---|
| Error Monitoring | ${SKILL_ROOT}/references/error-monitoring.md | Always | |
| Tracing | ${SKILL_ROOT}/references/tracing.md | Route/request performance visibility needed | |
| Profiling | ${SKILL_ROOT}/references/profiling.md | Server performance analysis needed | |
| Session Replay | ${SKILL_ROOT}/references/session-replay.md | User-facing app | |
| Logs | ${SKILL_ROOT}/references/logging.md | Structured logs/correlation needed | |
| User Feedback | ${SKILL_ROOT}/references/user-feedback.md | In-app feedback flows needed | |
| Framework Features | ${SKILL_ROOT}/references/react-router-framework-features.md | Entry files, wrappers, source maps, startup import strategy |
For each feature: Read ${SKILL_ROOT}/references/<feature>.md, follow steps exactly, verify it works.
Configuration Reference
Key Sentry.init() options
| Option | Type | Default | Notes | ||
|---|---|---|---|---|---|
dsn | string | — | Required; SDK disabled when empty | ||
dataCollection | object | — | Controls what data is collected (userInfo, cookies, httpHeaders, etc.) | ||
dataCollection.userInfo | boolean | true | Includes IP-derived user context | ||
dataCollection.cookies | CollectBehavior | true | Controls cookie collection and filtering | ||
dataCollection.httpHeaders | object | { request: true, response: true } | Controls HTTP header collection | ||
sendDefaultPii | boolean | false | Deprecated: Use dataCollection instead; removed in v11 | ||
integrations | Integration[] | SDK defaults | Add tracing/replay/feedback/profiling integrations | ||
enableLogs | boolean | false | Enables Sentry.logger.* ingestion | ||
tracesSampleRate | number | — | Usually 1.0 in testing, lower in production | ||
tracePropagationTargets | `(string | RegExp)[]` | SDK defaults | URLs that receive tracing headers | |
replaysSessionSampleRate | number | — | Fraction of all sessions recorded | ||
replaysOnErrorSampleRate | number | — | Fraction of error sessions recorded | ||
profileSessionSampleRate | number | — | Fraction of transactions profiled (server profiling) | ||
tunnel | string | — | Optional ad-blocker bypass endpoint | ||
debug | boolean | false | Verbose SDK diagnostics |
Framework-specific APIs
| API | Purpose | |
|---|---|---|
reactRouterTracingIntegration() | Client-side tracing integration for framework mode | |
sentryOnError | Hooks into React Router HydratedRouter error reporting | |
createSentryHandleRequest(...) | Server request wrapper for framework entry server | |
createSentryHandleError(...) | Server error handler wrapper | |
wrapServerLoader(...) / wrapServerAction(...) | Manual wrapping for server loaders/actions | |
sentryReactRouter(...) | Vite plugin for source maps/build integration | |
sentryOnBuildEnd(...) | React Router build-end hook for source map processing |
Verification
Wizard-generated path
If wizard examples were generated, open /sentry-example-page and trigger test actions.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills-legacy/sentry-react-router-framework-sdk/SKILL.md
Popularity
- Repository stars
- 253
- Repository forks
- 30
- 7-day trend score
- 28
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 14 May 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/getsentry/sentry-for-ai/sentry-react-router-framework-sdk)