sentry-nextjs-sdk

Configure Sentry error monitoring, tracing, and session replay across Next.js runtimes.

2|Updated Jan 7, 2026
One-click install
npx skills add https://github.com/Lostovayne/Complete-Cursor-Clone-Next16 --skill sentry-nextjs-sdk-lostovayne
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sentry-nextjs-sdk
Source: https://github.com/Lostovayne/Complete-Cursor-Clone-Next16/tree/main/.agents/skills/sentry-nextjs-sdk
Command: npx skills add https://github.com/Lostovayne/Complete-Cursor-Clone-Next16 --skill sentry-nextjs-sdk-lostovayne

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

The Sentry Next.js SDK Skill provides end-to-end observability for Next.js projects by configuring error monitoring, tracing, session replay, and optional AI monitoring across client, server, and edge runtimes.

Core Features & Use Cases

  • Automated error monitoring and tracing across app routes, API routes, and middleware.
  • Server actions instrumentation and distributed tracing to connect frontend and backend flows.
  • AI monitoring integrations (OpenAI, Vercel AI SDK, Anthropic) for end-to-end observability of AI calls.
  • Optional logging, profiling, and session replay to deepen debugging and performance insights.

Use Case: A Next.js app with App Router and Pages Router can ship with unified DSN, spawn across three runtimes, and start capturing errors, traces, and AI calls from user sessions.

Quick Start

Install the Sentry Next.js SDK in your project and run the setup to configure client, server, and edge with tracing and AI monitoring.

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 error monitoring and tracing in Next.js requires configuring three runtime files: instrumentation-client.ts, sentry.server.config.ts, and sentry.edge.config.ts. This captures errors and traces across client, server, and edge runtimes.

Does Sentry work with both the Next.js App Router and Pages Router?

Yes, Sentry works with both the Next.js App Router and Pages Router. It provides automated error monitoring, distributed tracing, and session replay across app routes, API routes, and middleware for both routing paradigms.

Can I monitor OpenAI and Anthropic AI calls in my Next.js application?

You can monitor AI calls in Next.js using optional Sentry AI monitoring integrations. This provides end-to-end observability for operations using OpenAI, Vercel AI SDK, and Anthropic platforms.

What is distributed tracing for Next.js server actions and how does it connect frontend and backend?

Distributed tracing for Next.js server actions connects frontend and backend flows by linking user sessions to backend operations. This tracks errors and traces across the entire request lifecycle.

Do I need separate Sentry configurations for Next.js edge and server runtimes?

Yes, separate Sentry configurations are needed for Next.js edge and server runtimes. You create sentry.server.config.ts and sentry.edge.config.ts files to enable instrumentation across the three distinct runtimes.

How does session replay work with Next.js error monitoring?

Session replay works with Next.js error monitoring by capturing user interactions alongside errors. This optional feature deepens debugging by replaying frontend user sessions to identify root causes.