sentry-nextjs-sdk

Integrate Sentry SDK into Next.js for error monitoring and tracing.

Updated Mar 5, 2026
One-click install
npx skills add https://github.com/Himanshu040604/codex-skills-setup --skill sentry-nextjs-sdk-himanshu040604
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sentry-nextjs-sdk
Source: https://github.com/Himanshu040604/codex-skills-setup/tree/main/assets/codex/skills/claude-import/skills/plugins/sentry%40claude-plugins-official/skills/sentry-nextjs-sdk
Command: npx skills add https://github.com/Himanshu040604/codex-skills-setup --skill sentry-nextjs-sdk-himanshu040604

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill simplifies the complex process of integrating Sentry's powerful error monitoring, performance tracing, and session replay capabilities into a Next.js application, ensuring robust observability across all runtimes.

Core Features & Use Cases

  • Comprehensive Error Monitoring: Captures client-side, server-side, and edge runtime errors.
  • Performance Tracing: Instruments API routes, Server Components, navigations, and outgoing requests to identify bottlenecks.
  • Session Replay: Records user sessions to visually debug issues, including network requests and DOM mutations.
  • AI Monitoring: Tracks LLM calls, token usage, and costs for AI-powered features.
  • Cron Monitoring: Detects missed or failed scheduled jobs.
  • Use Case: You've deployed a Next.js application and want to proactively catch and debug errors, understand performance issues, and visually replay user sessions to pinpoint the root cause of bugs.

Quick Start

Use the sentry-nextjs-sdk skill to add Sentry error monitoring and tracing to your Next.js application.

Frequently Asked Questions about sentry-nextjs-sdk

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

FAQPage Schema
How do I add Sentry error monitoring to a Next.js application?

To add Sentry error monitoring to a Next.js application, configure the SDK with your DSN, set sampling rates, and initialize runtime-specific files for client, server, and edge environments to capture errors comprehensively.

Can I track performance tracing and session replays in Next.js with Sentry?

Yes, Sentry performance tracing and session replay in Next.js instruments API routes, Server Components, and navigations to identify bottlenecks, while recording user sessions to visually debug network requests and DOM mutations.

Does Sentry SDK work with Next.js edge runtime environments?

Sentry SDK fully supports Next.js edge runtime environments, alongside client and server runtimes, ensuring comprehensive error monitoring and performance tracing across all execution contexts within your application.

How do I monitor LLM calls and token usage in a Next.js app?

To monitor LLM calls and token usage in a Next.js app, use Sentry's AI monitoring features to track LLM invocations, token consumption, and associated costs for your AI-powered features.

Can Sentry detect missed or failed cron jobs in a Next.js project?

Yes, Sentry can detect missed or failed scheduled jobs in a Next.js project using its cron monitoring capabilities, allowing you to track the execution and health of your scheduled tasks.

What configuration is required to set up Sentry session replay in Next.js?

Setting up Sentry session replay in Next.js requires configuring your project DSN, defining appropriate sampling rates, and creating runtime-specific initialization files to start capturing user sessions and DOM mutations.