# Sentry for Next.js — card for AI agents

Official Sentry SDK for error tracking and performance monitoring in Next.js apps.

Category: Logging, monitoring and analytics · npm package `@sentry/nextjs` · latest version 11.10.0 (checked 2026-11-01)
Install: `npm install @sentry/nextjs`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## Sentry for Next.js
- Start setup with the wizard, `npx @sentry/wizard@latest -i nextjs`.
- Initialize the SDK with the DSN from the Sentry project's Client Keys (DSN) settings. Never invent a DSN.
- Set the environment through a `SENTRY_ENVIRONMENT` variable or in the SDK config, so alerts and issue filters can work per environment.
- Do not ship `tracesSampleRate: 1.0` to production unchanged. Lower it or use `tracesSampler`, as Sentry's snippets advise.
- For Next.js on Cloudflare Workers (for example OpenNext), wrap the Worker entry with `withSentry` from `@sentry/nextjs/cloudflare` and read the DSN from `env.SENTRY_DSN`.
- For a monolithic codebase, the docs recommend separate Sentry projects for backend and frontend.

## Agent Skills for it
- nextjs-app-router-patterns from wshobson/agents: `npx skills add wshobson/agents --skill nextjs-app-router-patterns`
- nextjs-developer from Jeffallan/claude-skills: `npx skills add Jeffallan/claude-skills --skill nextjs-developer`
- nextjs-developer from zebbern/claude-code-guide: `npx skills add zebbern/claude-code-guide --skill nextjs-developer`
- nextjs-on-cloudflare from cloudflare/skills: `npx skills add cloudflare/skills --skill nextjs-on-cloudflare`
- nextjs-mastery from rohitg00/awesome-claude-code-toolkit: `npx skills add rohitg00/awesome-claude-code-toolkit --skill nextjs-mastery`
- nextjs-app-router-patterns from rmyndharis/antigravity-skills: `npx skills add rmyndharis/antigravity-skills --skill nextjs-app-router-patterns`

## Docs written for agents
- [llms.txt (index of the docs)](https://sentry.io/llms.txt)

## What it is
- `@sentry/nextjs` is the Next.js member of Sentry's official JavaScript SDKs. The README lists it as "SDK for Next.js", next to high-level SDKs for browsers, Node, React, Remix, SvelteKit, Cloudflare and other platforms. The repository it ships from is MIT-licensed and was created on 2012-02-01. The README links a few SDKs, including Electron, React Native and Capacitor, to separate repositories.
- The README says every SDK is set up the same way. You add the high-level package, then call `Sentry.init` with a DSN. The DSN comes from a project in a Sentry account. The docs say that once the SDK is initialized, errors from your code are tied to that project, wherever the code runs. Sentry's site gives a Next.js setup wizard: `npx @sentry/wizard@latest -i nextjs`.
- The latest release, 11.6.0 (2026-10-08), adds a `@sentry/nextjs/cloudflare` entry point for Next.js apps on Cloudflare Workers.

## Caveats
- Needs a Sentry project and DSN: The SDK reports to Sentry. Before anything is captured, you create a project and copy its key from the Client Keys (DSN) settings.
- Sample snippets trace everything: Sentry's JavaScript snippet sets `tracesSampleRate: 1.0`. Its own comment recommends adjusting this in production or using `tracesSampler`.
- No fixed window for older versions: The README's version policy ties fixes and features for older versions to community demand and usage. It does not state a support period.
- Automatic issue creation is plan-gated: The docs say alerts that automatically create Jira or Azure DevOps issues work only on a Business or Trial plan.
- Profiling list does not name Next.js: The profiling FAQ names Browser JavaScript, Python, Node, PHP, Android and iOS SDKs. Next.js is not listed by name, so check the Next.js guide before relying on profiling.

## Numbers (AgentGid data)
- Gid Score: 70.5 (#362 of all tools, 10 of 121 in its category)
- Used in 99 public projects set up for AI coding agents (1.6%)
- Downloads last week: 17,715,617 (as of 2026-11-24), +43.7% over 4 weeks
- GitHub stars: 8,782 (as of 2026-11-24)
- Last push: 2026-11-24

## Often used with
Next.js 98.0%, clsx 80.8%, Tailwind Merge 77.8%, Lucide React 77.8%, React 99.0%, Class Variance Authority 68.7%

## Checked alternatives (same job)
- Vercel Speed Insights: https://agentgid.com/tools/vercel-speed-insights/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/sentry-nextjs/
- Homepage: https://github.com/getsentry/sentry-javascript/tree/master/packages/nextjs
- Repository: https://github.com/getsentry/sentry-javascript
- Source: https://github.com/getsentry/sentry-javascript#readme
- Source: https://github.com/getsentry/sentry-javascript
- Source: https://github.com/getsentry/sentry-javascript/releases
- Source: https://sentry.io
- Source: https://docs.sentry.io/organization/getting-started/
- Source: https://sentry.io/product/profiling/

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
