sentry-nextjs-sdk
Audited by Runlayer on Mar 3, 2026
Tool passed security scan
Malicious tool definition detected
Malicious tool definition detected
Description: in all three config files: ```typescript // instrumentation-client.ts import * as Sentry from "@sentry/nextjs"; Sentry.init({ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, enableLogs: true, integrations: [Sentry.consoleLoggingIntegration({ levels: ["warn", "error"] })], }); // sentry.server.config.ts import * as Sentry from "@sentry/nextjs"; Sentry.init({ dsn: process.env.SENTRY_DSN, enableLogs: true, integrations: [Sentry.pinoIntegration()], // or consoleLoggingIntegration }); // sentry
Tool passed security scan
Malicious tool definition detected
### Automatic SSR → Client Trace Continuation When Next.js server-renders a page, Sentry emits trace context as `<meta>` tags in `<head>`.
Description: opt into true nesting (use with care — can produce incorrect data with concurrent async operations): ```typescript Sentry.init({ parentSpanIsAlwaysRootSpan: false, }); ``` --- ## Complete Config Example (All Three Runtimes) ```typescript // instrumentation-client.ts (Browser) import * as Sentry from "@sentry/nextjs"; Sentry.init({ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, environment: process.env.NODE_ENV, integrations: [ Sentry.browserTracingIntegration({ shouldCreateSpanForRequest:
Tool passed security scan
Malicious tool definition detected
```typescript Sentry.replayIntegration({ // Capture details for all same-origin requests networkDetailAllowUrls: [ window.location.origin, "api.example.com", /^https:\/\/api\.example\.com/, ], // Exclude PII-heavy endpoints networkDetailDenyUrls: ["/api/auth", /\/users\/\d+\/private/], networkCaptureBodies: true, networkRequestHeaders: ["Cache-Control", "X-Request-ID"], networkResponseHeaders: ["X-RateLimit-Remaining"], }); ``` **Limits:** - Bodies truncated to **150k characters** max. - Only te
Malicious tool definition detected
Both default to `true` only when `sendDefaultPii: true` is set: ```typescript Sentry.init({ dsn: process.env.SENTRY_DSN, sendDefaultPii: true, // ← enables input/output recording by default tracesSampleRate: 1.0, }); ``` Or enable explicitly without `sendDefaultPii`: ```typescript integrations: [ Sentry.openAIIntegration({ recordInputs: true, // explicitly opt in recordOutputs: true, }), ], ``` > ⚠️ **PII warning:** Prompts often contain user-supplied text.
Malicious tool definition detected
--- ## 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@lat
Tool passed security scan
Malicious tool definition detected
--- ## Alerting Create issue alerts filtered by the tag **`monitor.slug`** equals `[your-monitor-slug]` in Sentry's Alerts sidebar.
Tool passed security scan
Malicious tool definition detected