Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 4 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

Sentry for Next.js

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

Logging, monitoring and analyticsNPM

GitHubWebsiteAPI page

1. License

License from npm.

github.com/getsentry/sentry-javascript

From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error

What Sentry for Next.js does

@sentry/nextjs is the Next.js entry in Sentry's official JavaScript SDK repository. It follows the same install-then-<code>Sentry.init</code> pattern as its sibling SDKs and reports to a Sentry project, where Sentry says errors, logs, replays and spans are "all connected by the same trace".

Sentry for Next.js popularity

70 / 100
Gid Score, #362 overall
17.7M
downloads a week, npm
8,782
GitHub stars
99
agent projects use it
Sentry for Next.js: downloads per weeknpm, @sentry/nextjs 17,715,617
Sentry for Next.js: GitHub starsgetsentry/sentry-javascript 8,782

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How Sentry for Next.js is used

  • Sentry for Next.js is a dependency in 99 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (2.0% of the 4,867 JavaScript/TypeScript ones), #4 of 121 in logging, monitoring and analytics.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 260; those are left out of every share on this page.
  • The most used alternative in our scan is Vercel Speed Insights (109 projects).
  • Projects that use it most often also use Next.js (98.0%), clsx (80.8%), Tailwind Merge (77.8%).

By coding agent

58 projects, 1.8%
54 projects, 2.2%
53 projects, 1.7%
11 projects, 2.3%
9 projects, 1.9%

Often used with

In 98.0% of its projects
In 80.8% of its projects
In 77.8% of its projects
In 77.8% of its projects
In 99.0% of its projects
In 68.7% of its projects
In 93.9% of its projects
In 61.6% of its projects

Sentry for Next.js in practice

Strengths

A Next.js-specific setup wizard

Sentry's site lists a wizard for Next.js: <code>npx @sentry/wizard@latest -i nextjs</code>. In the site's words, "it's really just one command".

Same spans on Cloudflare Workers as on Node.js

Release 11.6.0 adds <code>@sentry/nextjs/cloudflare</code>. It exports <code>withSentry</code> for the Worker entry, for example OpenNext's <code>.open-next/worker.js</code>. The release notes say this gives a Next.js app on Workers the same spans it gets on Node.js.

Sentry links signals through one trace

Sentry's site says errors, logs, replays, spans, profiles and metrics are "all connected by the same trace", and adds "That's kind of our thing." Its examples are debugging 500s and replaying <code>fetch()</code> failures.

Clock drift after device sleep is corrected

The browser's <code>performance.now()</code> clock stops while a device sleeps, so span timestamps recorded afterwards could be too early. Per the 11.6.0 notes, the SDK now detects this drift and corrects its time origin.

Watch out for

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 <code>tracesSampleRate: 1.0</code>. Its own comment recommends adjusting this in production or using <code>tracesSampler</code>.

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.

The init pattern every Sentry JS SDK follows (shown in the README with @sentry/browser)

import * as Sentry from '@sentry/browser';

Sentry.init({
  dsn: '__DSN__',
  // ...
});

Sentry.captureMessage('Hello, world!');

More about Sentry for Next.js

Funding
  • Own page: https://sentry.io/pricing/
  • Own page: https://sentry.io/

See all

Agent Skills for it
  • nextjs-app-router-patterns: Master Next.js 14+ App Router with Server Components, streaming, parallel routes, and advanced data fetching. Use when building Next.js appl
  • nextjs-developer: Use when building Next.js 14+ applications with App Router, server components, or server actions. Invoke to configure route handlers, implem
  • nextjs-developer: Use when building Next.js 14+ applications with App Router, server components, or server actions. Invoke for full-stack features, performanc
  • nextjs-on-cloudflare: Build, migrate, and deploy Next.js apps on Cloudflare Workers with vinext. Use when starting a Next.js project on Cloudflare, moving an exis
  • nextjs-mastery: Next.js 14+ App Router patterns including RSC, ISR, middleware, parallel routes, and data fetching
  • nextjs-app-router-patterns: Master Next.js 14+ App Router with Server Components, streaming, parallel routes, and advanced data fetching. Use when building Next.js appl

See all

Packages around it
  • next: Next.js framework
  • clsx: className builder
  • tailwind-merge: Tailwind class merging
  • react: UI library
  • lucide-react: Icon set
  • class-variance-authority: Component variants
More in Logging, monitoring and analytics

Alternatives

Sentry for Next.js This page

MITGid 7017.7M/wk

Vercel Speed Insights

Measure web performance metrics and get recommendations for improvement.

Apache-2.0Gid 557.3M/wk

Compare Sentry for Next.js with another tool

Get started

Install it.

npm install @sentry/nextjs

Rules for your agent

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.