sentry-nextjs-sdk

Automate Sentry Next.js SDK integration for Next.js 13+ apps.

20|3|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/getsentry/sentry-agent-skills --skill sentry-nextjs-sdk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sentry-nextjs-sdk
Source: https://github.com/getsentry/sentry-agent-skills/tree/main/skills/sentry-nextjs-sdk
Command: npx skills add https://github.com/getsentry/sentry-agent-skills --skill sentry-nextjs-sdk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Next.js teams often struggle to reliably integrate Sentry across client, server, and edge runtimes. This skill provides a comprehensive, opinionated setup to configure error monitoring, tracing, session replay, logging, profiling, AI monitoring, and crons for Next.js applications.

Core Features & Use Cases

  • Unified initialization across browser, Node.js server, and Edge runtimes
  • Phase-oriented guidance for enabling error capture, tracing, session replay, and observability
  • Works with Next.js App Router and Pages Router projects, including server actions, middleware, and API routes

Quick Start

Install and configure the Sentry Next.js SDK across client, server, and edge runtimes to enable end-to-end observability and verification.

Frequently Asked Questions about sentry-nextjs-sdk

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

FAQPage Schema
How do I set up Sentry error monitoring and tracing in a Next.js app?

Sentry session replay works with Next.js by configuring the SDK to capture user interactions across browser and server runtimes. This enables end-to-end observability, allowing you to replay sessions and trace errors back to their origin in either App Router or Pages Router projects.

Can I use Sentry to monitor server actions and middleware in Next.js?

Sentry AI monitoring for Next.js applications is configured by initializing the SDK with the appropriate runtimes. This setup captures AI-related operations and logs, providing observability for AI features running within your Next.js 13+ App Router or Pages Router environment.

What are the requirements for integrating Sentry with a Next.js project?

Integrating Sentry with a Next.js project requires Next.js version 13 or higher and the @sentry/nextjs package. The SDK supports both App Router and Pages Router architectures to enable error monitoring, profiling, and logging across client, server, and edge environments.

Does Sentry SDK support both App Router and Pages Router in Next.js?

Sentry cron monitoring in Next.js is set up by configuring the SDK to track scheduled tasks. This integration requires the @sentry/nextjs package and Next.js 13+, allowing you to monitor the execution and success of cron jobs alongside standard error monitoring and tracing.