Install the "sentry-nextjs-sdk" agent skill from https://github.com/getsentry/sentry-for-ai/tree/main/skills-legacy/sentry-nextjs-sdk into .claude/skills/sentry-nextjs-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sentry-nextjs-sdk", then confirm the skill loads.
Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Type this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
skills CLI
$ npx skills add getsentry/sentry-for-ai --skill sentry-nextjs-sdk -a codex
Project install goes to .agents/skills/; add -g for ~/.codex/skills/.
Install the "sentry-nextjs-sdk" agent skill from https://github.com/getsentry/sentry-for-ai/tree/main/skills-legacy/sentry-nextjs-sdk into .agents/skills/sentry-nextjs-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sentry-nextjs-sdk", then confirm the skill loads.
Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skills CLI
$ npx skills add getsentry/sentry-for-ai --skill sentry-nextjs-sdk -a cursor
Project install goes to .agents/skills/; add -g for ~/.cursor/skills/.
Install the "sentry-nextjs-sdk" agent skill from https://github.com/getsentry/sentry-for-ai/tree/main/skills-legacy/sentry-nextjs-sdk into .cursor/skills/sentry-nextjs-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sentry-nextjs-sdk", then confirm the skill loads.
Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
skills CLI
$ npx skills add getsentry/sentry-for-ai --skill sentry-nextjs-sdk -a gemini-cli
Project install goes to .agents/skills/; add -g for ~/.gemini/skills/.
Install the "sentry-nextjs-sdk" agent skill from https://github.com/getsentry/sentry-for-ai/tree/main/skills-legacy/sentry-nextjs-sdk into .gemini/skills/sentry-nextjs-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sentry-nextjs-sdk", then confirm the skill loads.
Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Installs for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
skills CLI
$ npx skills add getsentry/sentry-for-ai --skill sentry-nextjs-sdk -a github-copilot
Project install goes to .agents/skills/; add -g for ~/.copilot/skills/.
Install the "sentry-nextjs-sdk" agent skill from https://github.com/getsentry/sentry-for-ai/tree/main/skills-legacy/sentry-nextjs-sdk into .github/skills/sentry-nextjs-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sentry-nextjs-sdk", then confirm the skill loads.
GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skills CLI
$ npx skills add getsentry/sentry-for-ai --skill sentry-nextjs-sdk -a opencode
OpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
Install the "sentry-nextjs-sdk" agent skill from https://github.com/getsentry/sentry-for-ai/tree/main/skills-legacy/sentry-nextjs-sdk into .opencode/skills/sentry-nextjs-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sentry-nextjs-sdk", then confirm the skill loads.
OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Facts
Skill name
sentry-nextjs-sdk
GitHub stars
268
Token cost
~4.7k tokens
SKILL.md length
1,324 words
Files
9 (incl. references)
Skills in repo
32
Repo updated
First seen
Licence
Apache-2.0
At a glance
Full Sentry SDK setup for Next.js. An agent skill from getsentry/sentry-for-ai.
Works in 4 steps: Detect → Recommend → Guide → …
Asked to add Sentry to Next.js
SKILL.md covers Invoke This Skill When, Phase 1: Detect, Phase 2: Recommend and Phase 3: Guide, plus 4 more sections
Sentry Nextjs SDK is an agent skill from getsentry/sentry-for-ai, published by the product's own GitHub organization. Full Sentry SDK setup for Next.js. Use when asked to "add Sentry to Next.js", "install @sentry/nextjs", or configure error monitoring, tracing, session replay, logging, profiling, AI monitoring, or crons for Next.js applications. Supports Next.js 13+ with App Router and Pages Router.
Its SKILL.md is about 4.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including reference files (for example `references/ai-monitoring.md`, `references/crons.md` and `references/error-monitoring.md`).
It sits in Productivity & Automation, covering Scheduled and recurring tasks. It works with Sentry and Next.js. The repository describes itself as: Teach your AI coding assistant how to use Sentry - setup, debugging, alerts, and more. The licence is Apache-2.0.
When your agent uses it
Asked to add Sentry to Next.js
Install @sentry/nextjs
Configure error monitoring
Crons for Next.js applications
Example prompts
“add Sentry to Next.js”
“install @sentry/nextjs”
“/sentry-nextjs-sdk”
Requirements
Node.js
A credential in SENTRY_AUTH_TOKEN
Workflow steps
4 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit d8fd106. It shows what the files ask for, not the result of running them.
Tool permissions
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Runs code
Shell commands in SKILL.md call:
npm
From the folder's file list and the shell code blocks in SKILL.md.
Network
Hosts in commands or code, which the agent is likely to contact:
docs.sentry.io
Also links to:
sentry.io
From URLs in SKILL.md, links to its own repository left out.
Credentials
Names these keys or tokens, usually read from environment variables:
SENTRY_AUTH_TOKEN
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Context cost
Sentry Nextjs SDK loads about 4.7k tokens when it runs, and up to ~36k if it reads all its reference files. Until then it costs about 76 tokens; SKILL.md has 1,324 words of instructions outside code blocks.
Always· name and description, kept in context so the agent knows when to use it
~76
When it runs· the whole SKILL.md, loaded when a task matches
~4.7k
With references· SKILL.md plus every file in references/, read only if the agent opens them
~36k
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
Safety
Auto-check: notes
The automated check noted patterns worth knowing about, such as sudo or a known installer.
NoteMentions a .env fileSKILL.md:345
TH_TOKEN, // from CI env or a gitignored .env.sentry-build-plugin
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
Download SKILL.mdSave it as .claude/skills/sentry-nextjs-sdk/SKILL.md (or your agent's skills folder). This skill also uses 8 other files; get the full folder from GitHub.
name
sentry-nextjs-sdk
description
Full Sentry SDK setup for Next.js. Use when asked to "add Sentry to Next.js", "install @sentry/nextjs", or configure error monitoring, tracing, session replay, logging, profiling, AI monitoring, or crons for Next.js applications. Supports Next.js 13+ with App Router and Pages Router.
Opinionated wizard that scans your Next.js project and guides you through complete Sentry setup across all three runtimes: browser, Node.js server, and Edge.
Invoke This Skill When
User asks to "add Sentry to Next.js" or "set up Sentry" in a Next.js app
User wants to install or configure @sentry/nextjs
User wants error monitoring, tracing, session replay, logging, or profiling for Next.js
User asks about instrumentation.ts, withSentryConfig(), or global-error.tsx
User wants to capture server actions, server component errors, or edge runtime errors
Note: SDK versions and APIs below reflect current Sentry docs at time of writing (@sentry/nextjs ≥8.28.0).
Always verify against docs.sentry.io/platforms/javascript/guides/nextjs/ before implementing.
Phase 1: Detect
Run these commands to understand the project before making any recommendations:
bash
# Detect Next.js version and existing Sentry
cat package.json | grep -E '"next"|"@sentry/'
# Detect router type (App Router vs Pages Router)
ls src/app app src/pages pages 2>/dev/null
# Check for existing Sentry config files
ls instrumentation.ts instrumentation-client.ts sentry.server.config.ts sentry.edge.config.ts 2>/dev/null
ls src/instrumentation.ts src/instrumentation-client.ts 2>/dev/null
# Check next.config
ls next.config.ts next.config.js next.config.mjs 2>/dev/null
# Check for existing error boundaries
find . -name "global-error.tsx" -o -name "_error.tsx" 2>/dev/null | grep -v node_modules
# Check build tool
cat package.json | grep -E '"turbopack"|"webpack"'
# Check for logging libraries
cat package.json | grep -E '"pino"|"winston"|"bunyan"'
# Check for companion backend
ls ../backend ../server ../api 2>/dev/null
cat ../go.mod ../requirements.txt ../Gemfile 2>/dev/null | head -3
What to determine:
Question
Impact
Next.js version?
13+ required; 15+ needed for Turbopack support
App Router or Pages Router?
Determines error boundary files needed (global-error.tsx vs _error.tsx)
@sentry/nextjs already present?
Skip install, go to feature config
Existing instrumentation.ts?
Merge Sentry into it rather than replace
Turbopack in use?
Tree-shaking in withSentryConfig is webpack-only
Logging library detected?
Recommend Sentry Logs integration
Backend directory found?
Trigger Phase 4 cross-link suggestion
Phase 2: Recommend
Present a concrete recommendation based on what you found. Don't ask open-ended questions — lead with a proposal:
Recommended (core coverage):
✅ Error Monitoring — always; captures server errors, client errors, server actions, and unhandled promise rejections
✅ Tracing — server-side request tracing + client-side navigation spans across all runtimes
✅ Session Replay — recommended for user-facing apps; records sessions around errors
Optional (enhanced observability):
⚡ Logging — structured logs via Sentry.logger.*; recommend when pino/winston or log search is needed
App makes OpenAI, Vercel AI SDK, or Anthropic calls
Crons
App has Vercel Cron jobs, scheduled API routes, or node-cron usage
Metrics
App needs custom counters, gauges, or histograms via Sentry.metrics.*
Propose: "I recommend setting up Error Monitoring + Tracing + Session Replay. Want me to also add Logging or Profiling?"
Phase 3: Guide
Option 1: Wizard (Recommended)
You need to run this yourself — the wizard opens a browser for login and requires interactive input that the agent can't handle. Copy-paste into your terminal:
npx @sentry/wizard@latest -i nextjs
It handles login, org/project selection, SDK installation, config files (instrumentation-client.ts, sentry.server.config.ts, sentry.edge.config.ts, instrumentation.ts), next.config.ts wrapping, source map upload, and adds a /sentry-example-page.
Once it finishes, come back and skip to Verification.
If the user skips the wizard, proceed with Option 2 (Manual Setup) below.
Older docs used sentry.client.config.ts — the current pattern is instrumentation-client.ts.
typescript
import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN ?? "___PUBLIC_DSN___",
dataCollection: {
// To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/options/#dataCollection
// userInfo: false,
// httpBodies: [],
},
// 100% in dev, 10% in production
tracesSampleRate: process.env.NODE_ENV === "development" ? 1.0 : 0.1,
// Session Replay: 10% of all sessions, 100% of sessions with errors
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
enableLogs: true,
integrations: [
Sentry.replayIntegration(),
// Optional: user feedback widget
// Sentry.feedbackIntegration({ colorScheme: "system" }),
],
});
// Hook into App Router navigation transitions (App Router only)
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
Create sentry.server.config.ts — Node.js Server Runtime
typescript
import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: process.env.SENTRY_DSN ?? "___DSN___",
dataCollection: {
// To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/options/#dataCollection
// userInfo: false,
// httpBodies: [],
},
tracesSampleRate: process.env.NODE_ENV === "development" ? 1.0 : 0.1,
// Attach local variable values to stack frames
includeLocalVariables: true,
enableLogs: true,
});
Create sentry.edge.config.ts — Edge Runtime
typescript
import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: process.env.SENTRY_DSN ?? "___DSN___",
dataCollection: {
// To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/options/#dataCollection
// userInfo: false,
// httpBodies: [],
},
tracesSampleRate: process.env.NODE_ENV === "development" ? 1.0 : 0.1,
enableLogs: true,
});
withSentryConfig uploads source maps on production builds so stack traces show your original code instead of minified output. The SDK-specific wiring is the authToken (plus widenClientFileUpload, which improves client stack traces) in next.config.ts:
typescript
withSentryConfig(nextConfig, {
org: "my-org",
project: "my-project",
authToken: process.env.SENTRY_AUTH_TOKEN, // from CI env or a gitignored .env.sentry-build-plugin
widenClientFileUpload: true,
});
SENTRY_AUTH_TOKEN is a build-time secret, distinct from the DSN. For creating the token, wiring it into CI, and troubleshooting minified traces, see sentry-source-maps.
Source maps are uploaded automatically on every next build.
For Each Agreed Feature
Load the corresponding reference file and follow its steps:
Custom counters, gauges, distributions via Sentry.metrics.*
For each feature: read the reference file, follow its steps exactly, and verify before moving on.
Configuration Reference
Show full SKILL.md (553 more words)Show less
Sentry.init() Options
Option
Type
Default
Notes
dsn
string
—
Required. Use NEXT_PUBLIC_SENTRY_DSN for client, SENTRY_DSN for server
tracesSampleRate
number
—
0–1; 1.0 in dev, 0.1 in prod recommended
replaysSessionSampleRate
number
0.1
Fraction of all sessions recorded
replaysOnErrorSampleRate
number
1.0
Fraction of error sessions recorded
dataCollection
object
conservative unless set
Fine-grained control over auto-collected categories (userInfo, cookies, httpHeaders, httpBodies, queryParams, genAI). When omitted, the SDK falls back to sendDefaultPii (default false). Passing the object — even {} — flips unset categories to their permissive defaults; opt out per category.
includeLocalVariables
boolean
false
Attach local variable values to stack frames (server only)
enableLogs
boolean
false
Enable Sentry Logs product
environment
string
auto
"production", "staging", etc.
release
string
auto
Set to commit SHA or version tag
debug
boolean
false
Log SDK activity to console
withSentryConfig() Options
Option
Type
Notes
org
string
Sentry organization slug
project
string
Sentry project slug
authToken
string
Source map upload token (SENTRY_AUTH_TOKEN)
widenClientFileUpload
boolean
Upload more client files for better stack traces
tunnelRoute
string
API route path for ad-blocker bypass (e.g. "/monitoring")
Tree-shake SDK features (webpack only, not Turbopack)
Environment Variables
Variable
Runtime
Purpose
NEXT_PUBLIC_SENTRY_DSN
Client
DSN for browser Sentry init (public)
SENTRY_DSN
Server / Edge
DSN for server/edge Sentry init
SENTRY_AUTH_TOKEN
Build
Source map upload auth token (secret)
SENTRY_ORG
Build
Org slug (alternative to org in config)
SENTRY_PROJECT
Build
Project slug (alternative to project in config)
SENTRY_RELEASE
Server
Release version string (auto-detected from git)
NEXT_RUNTIME
Server / Edge
"nodejs" or "edge" (set by Next.js internally)
Verification
After wizard or manual setup, verify Sentry is working:
typescript
// Add temporarily to a server action or API route, then remove
import * as Sentry from "@sentry/nextjs";
throw new Error("Sentry test error — delete me");
// or
Sentry.captureException(new Error("Sentry test error — delete me"));
Connecting frontend and backend with the same DSN or linked projects enables distributed tracing — stack traces that span your browser, Next.js server, and backend API in a single trace view.
Troubleshooting
Issue
Cause
Solution
Events not appearing
DSN misconfigured or debug: false hiding errors
Set debug: true temporarily; check browser network tab for requests to sentry.io
Stack traces show minified code
Source maps not uploading
Check SENTRY_AUTH_TOKEN is set; run next build and look for "Source Maps" in build output
onRequestError not firing
SDK version < 8.28.0
Upgrade: npm install @sentry/nextjs@latest
Edge runtime errors missing
sentry.edge.config.ts not loaded
Verify instrumentation.ts imports it when NEXT_RUNTIME === "edge"
Tunnel route returns 404
tunnelRoute set but Next.js route missing
The plugin creates it automatically; check you ran next build after adding tunnelRoute
withSentryConfig tree-shaking breaks build
Turbopack in use
Tree-shaking options only work with webpack; remove webpack.treeshake options when using Turbopack
global-error.tsx not catching errors
Missing "use client" directive
Add "use client" as the very first line of global-error.tsx
Session Replay not recording
replayIntegration() missing from client init
Add Sentry.replayIntegration() to integrations in instrumentation-client.ts
Sentry Nextjs SDK next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
Sentry Nextjs SDK compared with similar skills
Skill
Stars
Used in
Tokens
Auto-check
Licence
Repo updated
Sentry Nextjs SDK this skillgetsentry/sentry-for-ai
Turns a recurring chore into a scheduled or event-triggered Superset agent, drafting its prompt, picking a target and trigger, and reviewing the first run.
Define a Loop — a durable scaffold that works a queue of recurring tasks autonomously (Sentry issues, Front tickets, small perf PRs) with its outputs held for human review.
A skill your agent uses when adding durable execution to a TypeScript project — building retry-safe webhook handlers, background jobs that survive crashes, scheduled tasks, or long-running workflows…
Full Sentry SDK setup for Next.js. An agent skill from getsentry/sentry-for-ai. Sentry Nextjs SDK is an agent skill from getsentry/sentry-for-ai, published by the product's own GitHub organization.js.
When should I use Sentry Nextjs SDK?
Sentry Nextjs SDK fits situations like: asked to add Sentry to Next.js; install @sentry/nextjs; configure error monitoring; crons for Next.js applications.
How do I install Sentry Nextjs SDK in Claude Code?
Run `npx skills add getsentry/sentry-for-ai --skill sentry-nextjs-sdk -a claude-code`. Or copy the skill folder (skills-legacy/sentry-nextjs-sdk in getsentry/sentry-for-ai) into .claude/skills/sentry-nextjs-sdk in your project. Claude Code loads it when a task matches its description.
How do I install Sentry Nextjs SDK in Codex?
Run `npx skills add getsentry/sentry-for-ai --skill sentry-nextjs-sdk -a codex`. Or copy the skill folder (skills-legacy/sentry-nextjs-sdk in getsentry/sentry-for-ai) into .agents/skills/sentry-nextjs-sdk in your project. Codex loads it when a task matches its description.
Can I use Sentry Nextjs SDK in Cursor, Gemini CLI or GitHub Copilot?
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add getsentry/sentry-for-ai --skill sentry-nextjs-sdk -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sentry-nextjs-sdk, .gemini/skills/sentry-nextjs-sdk, .github/skills/sentry-nextjs-sdk and .opencode/skills/sentry-nextjs-sdk in your project.
What does Sentry Nextjs SDK need to run?
Going by SKILL.md and its folder, Sentry Nextjs SDK needs the command-line tools its instructions call (npm) and credentials named SENTRY_AUTH_TOKEN. Our summary lists: Node.js; A credential in SENTRY_AUTH_TOKEN.
Does Sentry Nextjs SDK access the network?
SKILL.md names 2 domains. In commands or code: docs.sentry.io; the agent is likely to contact it when it follows the instructions. As links in the text: sentry.io. This is read from the text; nothing was executed.
Is Sentry Nextjs SDK safe to install?
Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.
What licence does Sentry Nextjs SDK use?
Sentry Nextjs SDK is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
How many tokens does Sentry Nextjs SDK use?
About 4.7k tokens (SKILL.md is roughly 19k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 32k tokens, read only when the agent opens those files.
What are the alternatives to Sentry Nextjs SDK?
Skills that share tags, products or a category with Sentry Nextjs SDK: Superset Automate (superset-sh/superset, 15k stars), Supabase (curvenote/curvenote, 169 stars), Define Loop (yc-software/qm, 15k stars) and Inngest Setup (Asymmetric-al/core, 382 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Who maintains Sentry Nextjs SDK?
getsentry (a GitHub organization, an official publisher) maintains it in getsentry/sentry-for-ai, which has 268 GitHub stars. The repository holds 32 skills in this directory. The repository was last updated on October 7, 2026.
Source: getsentry/sentry-for-ai on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.