sentry-best-practices

Instrument Next.js server and client code with the Sentry SDK.

20|3|Updated Nov 30, 2025
One-click install
npx skills add https://github.com/andrelandgraf/fullstackrecipes --skill sentry-best-practices
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sentry-best-practices
Source: https://github.com/andrelandgraf/fullstackrecipes/tree/main/templates/fullstackrecipe/.agents/skills/sentry-best-practices
Command: npx skills add https://github.com/andrelandgraf/fullstackrecipes --skill sentry-best-practices

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Standardize and simplify error handling in Next.js apps by providing clear guidelines for capturing exceptions, attaching user context, and logging with Sentry.

Core Features & Use Cases

  • Capture exceptions and attach user/context to provide actionable insights.
  • Add breadcrumbs and spans to trace performance and context across app flows.
  • Use structured logging to surface important events in the Logs tab for debugging.

Quick Start

Install the Sentry Next.js SDK and begin instrumenting your app by capturing exceptions, setting the user context, and starting spans for performance.

Frequently Asked Questions about sentry-best-practices

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

FAQPage Schema
How do I instrument error tracking in Next.js API routes and server-side rendering?

Next.js error tracking instrumentation involves capturing exceptions in both server and client code, including API routes and rendering tasks. You use the Sentry Next.js SDK to capture exceptions, attach user context, and trace performance across app flows.

What is the best way to capture user context and breadcrumbs for Next.js errors?

Capturing user context and breadcrumbs in Next.js involves attaching actionable user data and tracing context across application flows. This is achieved using the Sentry SDK to bind user information and log breadcrumbs for debugging.

How do I add performance spans and structured logging to a Next.js application?

Adding performance spans and structured logging in Next.js requires starting spans to trace performance and surfacing important events in the Logs tab. The Sentry SDK provides the functions needed to create these spans and structured logs.

Does Sentry error tracking work with Next.js background tasks and client-side code?

Sentry error tracking works with Next.js background tasks and client-side code by applying instrumentation across both environments. It satisfies requirements for exception capture, user context binding, and breadcrumb tracing throughout the application.

Do I need to install the Sentry Next.js SDK to capture exceptions and trace performance?

You need to install the Sentry Next.js SDK to begin instrumenting your app for exception capture and performance tracing. This SDK provides the necessary APIs to capture errors, set user context, and start spans for performance monitoring.