{
 "kind": "tool",
 "slug": "sentry-nextjs",
 "path": "tools/sentry-nextjs/",
 "name": "Sentry for Next.js",
 "maker": null,
 "density": "profile",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Logging, monitoring and analytics",
   "tools/observability-analytics/"
  ]
 ],
 "lead": "Official Sentry SDK for error tracking and performance monitoring in Next.js apps.",
 "chips": [
  {
   "label": "Logging, monitoring and analytics",
   "path": "tools/observability-analytics/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install @sentry/nextjs"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/getsentry/sentry-javascript"
  },
  {
   "label": "Website",
   "href": "https://github.com/getsentry/sentry-javascript/tree/master/packages/nextjs"
  },
  {
   "label": "API page",
   "path": "apis/sentry/"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": null,
   "note": "License from npm.",
   "src": "https://github.com/getsentry/sentry-javascript"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 24, 2026",
   "note": "Latest GitHub release Nov 23, 2026. ",
   "src": "https://github.com/getsentry/sentry-javascript"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "99 projects",
   "status": "info",
   "sub": "#4 of 121 in its category",
   "note": "Dependency in 99 public GitHub projects set up for AI coding agents that we scanned (1.6%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Docs for agents",
   "status": "yes",
   "sub": "llms.txt",
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": "https://sentry.io/llms.txt"
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What Sentry for Next.js does",
   "parts": [
    {
     "t": "prose",
     "text": "@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\"."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "Sentry for Next.js popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "70",
       "of": "/ 100",
       "l": "Gid Score, #362 overall"
      },
      {
       "n": "17.7M",
       "l": "downloads a week, npm"
      },
      {
       "n": "8,782",
       "l": "GitHub stars"
      },
      {
       "n": "99",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How Sentry for Next.js is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "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%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "58 projects, 1.8%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "54 projects, 2.2%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "53 projects, 1.7%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "11 projects, 2.3%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      },
      {
       "l": "9 projects, 1.9%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 98.0% of its projects",
       "v": "Next.js",
       "path": "tools/next/"
      },
      {
       "l": "In 80.8% of its projects",
       "v": "clsx",
       "path": "tools/clsx/"
      },
      {
       "l": "In 77.8% of its projects",
       "v": "Tailwind Merge",
       "path": "tools/tailwind-merge/"
      },
      {
       "l": "In 77.8% of its projects",
       "v": "Lucide React",
       "path": "tools/lucide-react/"
      },
      {
       "l": "In 99.0% of its projects",
       "v": "React",
       "path": "tools/react/"
      },
      {
       "l": "In 68.7% of its projects",
       "v": "Class Variance Authority",
       "path": "tools/class-variance-authority/"
      },
      {
       "l": "In 93.9% of its projects",
       "v": "Tailwind CSS",
       "path": "tools/tailwindcss/"
      },
      {
       "l": "In 61.6% of its projects",
       "v": "Radix UI",
       "path": "tools/radix-ui/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "Sentry for Next.js in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "A Next.js-specific setup wizard",
       "v": "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\"."
      },
      {
       "l": "Same spans on Cloudflare Workers as on Node.js",
       "v": "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."
      },
      {
       "l": "Sentry links signals through one trace",
       "v": "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."
      },
      {
       "l": "Clock drift after device sleep is corrected",
       "v": "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."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Needs a Sentry project and DSN",
       "v": "The SDK reports to Sentry. Before anything is captured, you create a project and copy its key from the Client Keys (DSN) settings."
      },
      {
       "l": "Sample snippets trace everything",
       "v": "Sentry's JavaScript snippet sets <code>tracesSampleRate: 1.0</code>. Its own comment recommends adjusting this in production or using <code>tracesSampler</code>."
      },
      {
       "l": "No fixed window for older versions",
       "v": "The README's version policy ties fixes and features for older versions to community demand and usage. It does not state a support period."
      }
     ]
    },
    {
     "t": "h3",
     "text": "The init pattern every Sentry JS SDK follows (shown in the README with @sentry/browser)"
    },
    {
     "t": "tabs",
     "label": "Example",
     "items": [
      {
       "tab": "Javascript",
       "code": "import * as Sentry from '@sentry/browser';\n\nSentry.init({\n  dsn: '__DSN__',\n  // ...\n});\n\nSentry.captureMessage('Hello, world!');"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about Sentry for Next.js",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "Own page: https://sentry.io/pricing/",
        "Own page: https://sentry.io/"
       ]
      },
      {
       "title": "Agent Skills for it",
       "path": "skills/",
       "items": [
        "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"
       ]
      },
      {
       "title": "Packages around it",
       "items": [
        "next: Next.js framework",
        "clsx: className builder",
        "tailwind-merge: Tailwind class merging",
        "react: UI library",
        "lucide-react: Icon set",
        "class-variance-authority: Component variants"
       ]
      },
      {
       "title": "More in Logging, monitoring and analytics",
       "path": "tools/observability-analytics/",
       "items": [
        {
         "text": "Vercel Analytics",
         "path": "tools/vercel-analytics/"
        },
        {
         "text": "psutil",
         "path": "tools/psutil/"
        },
        {
         "text": "OpenTelemetry",
         "path": "tools/opentelemetry/"
        },
        {
         "text": "Pino",
         "path": "tools/pino/"
        },
        {
         "text": "structlog",
         "path": "tools/structlog/"
        },
        {
         "text": "PostHog JS",
         "path": "tools/posthog-js/"
        },
        {
         "text": "Loguru",
         "path": "tools/loguru/"
        },
        {
         "text": "pino-pretty",
         "path": "tools/pino-pretty/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "Sentry for Next.js",
       "me": true,
       "facts": [
        "MIT",
        "Gid 70",
        "17.7M/wk"
       ]
      },
      {
       "name": "Vercel Speed Insights",
       "why": "Measure web performance metrics and get recommendations for improvement.",
       "path": "tools/vercel-speed-insights/",
       "facts": [
        "Apache-2.0",
        "Gid 55",
        "7.3M/wk"
       ]
      }
     ],
     "more": "Compare Sentry for Next.js with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "npm install @sentry/nextjs"
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## Sentry for Next.js\n- Start setup with the wizard, `npx @sentry/wizard@latest -i nextjs`.\n- Initialize the SDK with the DSN from the Sentry project's Client Keys (DSN) settings. Never invent a DSN.\n- Set the environment through a `SENTRY_ENVIRONMENT` variable or in the SDK config, so alerts and issue filters can work per environment.\n- Do not ship `tracesSampleRate: 1.0` to production unchanged. Lower it or use `tracesSampler`, as Sentry's snippets advise.\n- 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`.\n- For a monolithic codebase, the docs recommend separate Sentry projects for backend and frontend.\n"
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm @sentry/nextjs"
  ],
  [
   "Category",
   "Logging, monitoring and analytics"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Latest version",
   "11.6.0, October 8, 2026"
  ],
  [
   "On GitHub since",
   "February 2012"
  ],
  [
   "Gid Score",
   "70.5"
  ],
  [
   "Rank in category",
   "#4 of 121"
  ],
  [
   "GitHub",
   "getsentry/sentry-javascript"
  ],
  [
   "Last change",
   "Nov 24, 2026"
  ]
 ],
 "good": [],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/getsentry.png"
}