npm / @sentry/nextjs
@sentry/nextjs
What changed in @sentry/nextjs 8 to 11, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.
@sentry/nextjs 1192 changes
Breaking changes 43
Bundler plugins now require Node.js 20.19.0 or higher.
Vercel deploy environments now use VERCEL_TARGET_ENV values; configure release.deploy.env to retain old names.
The webpack plugin now requires webpack 5.1 or higher.
Next.js forbidden() errors are no longer captured as errors.
Sentry.close() now unbinds the closed client, allowing getClient() and isInitialized() to reflect an uninitialized state before later init().
attachStacktrace now defaults to true.
Deprecated build-time configuration options were removed and can no longer be used.
Data collection is enabled by default.
dataCollection replaces sendDefaultPii.
Incoming HTTP body capture is controlled by dataCollection.httpBodies.
The enableLogs option is removed.
The enableMetrics option is removed.
Replace skipOpenTelemetrySetup with enableOpenTelemetrySetup for OpenTelemetry setup control.
The enableTruncation flag and AI integration truncation logic are removed.
endTimestamp is removed from SentrySpanArguments.
The deprecated _experiments.enableLogs option is removed.
gen_ai.system is renamed to gen_ai.provider.name.
gen_ai.tool.input is renamed to gen_ai.tool.call.arguments.
gen_ai.tool.output is renamed to gen_ai.tool.call.result.
gen_ai.request.available_tools is renamed to gen_ai.tool.definitions.
The deprecated gen_ai.tool.type span attribute is no longer set.
genAI defaults now collect AI data by default.
Deprecated http.* span attributes are renamed.
The deprecated http.target span attribute is replaced.
The deprecated inboundFiltersIntegration is removed.
The deprecated instrumentLangGraph API is removed.
Span kind is removed and moved to the sentry.kind attribute.
Deprecated net. span attributes are renamed.
Support for Next.js 13 was removed, requiring applications to use a newer Next.js version.
The minimum supported Node.js version is now 20.19.0.
SDK initialization via --require is no longer supported.
tRPC spans now use the rpc span operation.
attributes are now required in the sampling context.
The scope.clear() method is removed.
attributes are now required on ScopeData.
spanToJSON now returns StreamedSpanJSON.
The streamGenAiSpans flag is removed.
tracePropagation and propagateTrace option names are unified.
TypeScript 3.8 is no longer supported.
The unstable_sentryWebpackPluginOptions configuration was removed.
All spans now use url.full, url.fragment and url.query.
urlQueryParams replaces queryParams.
withSentryConfig moved to the @sentry/nextjs/config subpath.
Security 1
Query parameters are filtered in request error context to avoid sending sensitive values to Sentry.
Deprecations 2
The webpack.treeshake option is deprecated because bundleSizeOptimizations takes precedence when both are set.
Nested reactComponentAnnotation options now emit deprecation notices.
New APIs and options 7
OpenAI decisions.create calls now produce gen_ai.decide spans for tracing.
Adds a Cloudflare Workers entry point exporting withSentry for Next.js Worker handlers, providing the same spans as on Node.js.
Next.js route provider registration enables route provider handling for Next.js applications.
Runtimes without auto-instrumentation can manually instrument TypeSafe clients.
A default integration now automatically wraps MCP server instances, so manual wrapping is no longer required.
showReportDialog now accepts an onError callback.
A default integration creates evaluation spans for TypeSafe calls through the TypeSafe SDK.
Performance 1
Webpack and Turbopack use faster component annotation, improving bundler performance.
Behavior and default changes 24
The LinkedErrors integration now supports SuppressedError instances.
The top-level option now removes unused SDK code in webpack and Turbopack builds.
use cache fill spans now include the code.file.path attribute, providing the source file path for these spans.
Repeated Sentry.init() calls now warn; @sentry/nextjs returns the active client instead of undefined.
The server instrumentation now supports amqplib v2.
Vercel AI evaluation calls now create gen_ai.evaluate spans containing evaluation inputs and outputs.
Prisma 8 ORM calls now produce nested database query spans without requiring code changes.
The Turbopack orchestrion loader now runs only for instrumented packages.
beforeSendSpan is compatible with streamed spans by default.
Default environment and deploy names no longer include the vercel- prefix.
Framework functions now use the function span operation.
Terminal request handlers now use the handler span operation.
Locale routes using [lng] are parameterized, and narrower routes are preferred over catch-alls.
Next.js middleware spans now use the middleware span operation.
Web-server middleware now uses the middleware span operation.
Build-time instrumentation is automatically wired for Next.js projects.
Next.js prerender control flow errors are no longer reported to Sentry.
Backend router layers now use the router span operation.
The silent option now also suppresses the SDK's own build logs.
Span streaming is enabled by default.
Static route span names are now treated as low-cardinality names.
tracePropagationTargets matching is now case-insensitive.
Request data is now available to tracesSampler for edge middleware root spans.
Unsupported Turbopack warnings are now printed only once.
Tooling 1
Bundler plugins now use the sentry CLI SDK instead of @sentry/cli.
Fixes and other changes 13
Corrects telemetry timestamps after device sleep by detecting performance clock drift and recalculating span end times.
Pages Router error request URLs now include the configured basePath.
Requests using @sentry/cloudflare no longer initialize Sentry inside the request.
Next.js unauthorized() errors are no longer captured as errors.
Absolute router navigation URLs are no longer incorrectly prefixed with basePath.
The server instrumentation now supports tedious v20.
Turbopack loaders no longer load the Sentry CLI.
Server chunks no longer embed absolute filesystem paths.
Adds an import.meta.url shim to address an Orchestrion bundling regression in Next.js.
Turbopack development-server stack frames now receive correct in_app attribution.
Tunnel route requests are no longer bypassed by middleware.
Back and forward navigation types are preserved during span streaming.
SourceMappingURL stripping no longer truncates minified chunks.
@sentry/nextjs 10241 changes
Breaking changes 16
Errors propagated to application code are no longer reported as unhandled before application error handling runs; uncaught errors remain captured globally.
Removes the optional vite peer dependency from server-utils.
dataCollection.userInfo now defaults to true when dataCollection is provided, collecting auto-populated user fields by default.
Request data is migrated to dataCollection, changing how request data collection is configured.
Log-event inference of user data is now gated by sendDefaultPii instead of being enabled by default.
The provider-specific response timestamp attribute was removed without a replacement.
The flags context is now attached only to error events.
The provider-specific attribute was removed; use gen_ai.response.id instead.
The provider-specific attribute was removed; use gen_ai.response.model instead.
The provider-specific response timestamp attribute was removed without a replacement.
The provider-specific attribute was removed; use gen_ai.usage.output_tokens instead.
The provider-specific attribute was removed; use gen_ai.usage.input_tokens instead.
Pino version 9.10 or newer is required to continue receiving Pino logs.
Tracing is removed from the Next.js generation function template.
Always redacts sensitive header content, including when sendDefaultPii is enabled.
The default value of maxValueLength: 250 was removed.
Security 4
Lone surrogates are sanitized in log bodies and attributes before processing or transmission.
Data URLs in http.client spans are sanitized.
Allows sensitive routes to be excluded from injection into the client bundle.
Sentry's sensitive headers are leaked when
sendDefaultPiiis set totrue
Deprecations 8
Importing withSentryConfig from the existing entry point still works but logs a warning once, encouraging migration to the new path.
The scope.clear() method is deprecated.
sendDefaultPii is deprecated in favor of dataCollection and will be removed in v11.
The streamed fetch performance option is deprecated and replaced by fetchStreamPerformanceIntegration.
The Next.js integration now prints a Turbopack note when deprecated webpack options are used.
Webpack top-level options are deprecated in the Next.js integration; developers should avoid configuring Sentry through these options.
Deprecates transaction-based profiling through profilesSampleRate in favor of UI profiling sessions.
Metric options under _experiments are deprecated but continue working until the next major SDK version.
New APIs and options 69
Accepts a CollectBehavior shorthand for configuring HTTP header data collection.
Adds a new entry point exporting withSentryConfig, allowing next.config imports to remain compatible with the v11 path.
HTTP server spans now include parameterized routes through the http.route attribute.
HTTP server spans now include the complete request URL.
HTTP server spans now include the request URL path.
A new instrumentStateGraph API is available for instrumenting state graphs.
Stack frame variables can now be filtered by variable name.
@sentry/nextjs adds an opt-in for orchestrion instrumentation.
Set this Sentry.init option to opt out of the minimal provider and use OpenTelemetry's full BasicTracerProvider.
A new method lets developers extend integrations.
The async context strategy exposes whether tracing is suppressed.
Resource spans now include the url.full attribute for fuller URL details.
Adds functionality for recording database query summaries.
Adds a top-level API for setting Sentry attributes.
Adds a top-level API for setting multiple Sentry attributes.
Adds an API to bind a Sentry scope to an event emitter.
The dataCollection option lets you control each category of collected data.
Adds a client option for centrally controlling what data SDK features collect and send to Sentry.
Adds an integration for measuring time-to-first-byte and streaming duration of streamed fetch responses.
Adds a top-level applicationKey option to Next.js configuration.
Adds an option to send gen_ai spans separately when transaction payload size limits would otherwise drop them.
A client lifecycle hook now lets applications react when a replay session ends.
A client lifecycle hook now lets applications react when a replay session starts.
A tracing utility was added to propagate context across operations.
AI integrations can control whether large AI inputs and outputs are truncated.
Exposes rewriteSources as a top-level configuration option.
Adds an integration that captures the DOM structure when an error occurs for debugging.
Adds instrumentation for LangChain embeddings, creating gen_ai.embeddings spans; use this API in runtimes without automatic instrumentation.
The MCP integration now supports registerPrompt.
The MCP integration now supports registerResource.
The MCP integration now supports registerTool.
Adds instrumentation for Vercel queues in Next.js applications.
Adds experimental Turbopack React component name annotation for Next.js 16+, enabling component names in Replays, breadcrumbs, and performance monitoring.
Adds an experimental application key for enabling third-party error filtering in Turbopack builds.
A top-level option now controls which source map files are deleted after upload.
Enables automatic creation of Sentry cron monitors for Vercel Cron Jobs.
Adds an API to set a conversation ID that is automatically applied to spans, linking traces from the same multi-turn AI conversation.
Database spans support the db.system.name attribute.
Prisma v7 is supported by the Sentry integration.
Client reports can now identify ignored events with the ignored drop reason.
Enables additional context in fetch error messages to help with debugging.
OpenAI and LangChain instrumentation now adds the gen_ai.conversation.id attribute.
Tracing now adds gen_ai.request.messages.original_length attributes.
thirdPartyErrorFilterIntegration now supports ignoring Sentry internal frames during third-party error filtering.
WASM stack frames can receive an application key for first-party detection by thirdPartyErrorFilterIntegration.
Replay can attach raw request bodies from Request objects passed as the first fetch argument.
SDK scope attributes are applied to logs while their respective scopes are active.
Webpack tree-shaking flags can now be configured for the Next.js SDK.
Exports parameter types for captureException and captureMessage for use by TypeScript consumers.
Postgres.js instrumentation now supports ESM usage.
Adds the propagateTraceparent option for Node integrations.
Adds tracing support for AzureOpenAI.
Adds gibibyte and pebibyte values to the InformationUnit type.
Adds the manual UI profiling lifecycle mode, which is now the default and enables explicit profile control.
Introduces profileSessionSampleRate as the replacement for deprecated transaction-based profiling.
Adds APIs for working with scope attributes.
Adds an API to manually start UI profiling.
Adds support for universal random tunnel paths in Next.js.
Adds support for instrumenting LangGraph StateGraph operations in Node.
The Node instrumentation supports OpenAI SDK v6 integrations.
Adds beforeSendMetric as a top-level option for metric processing.
Adds enableMetrics as a top-level option for controlling metric sending.
Added automatic instrumentation for Firebase v2 Cloud Functions when tracing is enabled, providing performance tracking and error monitoring.
Added LangChain instrumentation support for Cloudflare and Vercel Edge environments.
Proxy files can now use the Node runtime, expanding runtime choices for Next.js proxy implementations.
Added LangChain AI instrumentation configurable through Sentry.langChainIntegration.
Added recordInputs to control whether prompts and messages are recorded by LangChain instrumentation.
Added recordOutputs to control whether LangChain responses are recorded.
Next.js proxy files are now supported by the integration.
Behavior and default changes 56
Attachments are excluded from internal exception events, preventing them from being included in those events.
Token usage is normalized while cache breakdowns are preserved for more consistent AI telemetry.
The SDK no longer instruments its own envelope requests, avoiding self-instrumentation.
The Pages Router runtime is excluded from App Router client bundles, reducing unintended client bundle content.
Vercel AI span processors are registered on Next.js for proper AI span processing.
The enableLogs client option now defaults to true, enabling Sentry Logs when logging APIs or integrations are actively used; set it to false to opt out.
Anthropic client instrumentation now instruments the client in place instead of using a deep proxy.
Dataloader spans now include a cache.key attribute for identifying the associated cache key.
Redis delete operations are captured as cache.remove operations.
Core fetch instrumentation now records the complete request URL.
Pageload and navigation spans now include url attributes, improving URL context in Next.js tracing data.
The Node SDK now uses Sentry's minimal tracer provider by default, reducing overhead when the full OpenTelemetry tracing stack is unnecessary.
Root-span sampling contexts now receive normalizedRequest for sampling decisions.
vercelAiIntegration now supports v7 of the ai package, though v7 is not yet supported on Cloudflare.
AI message data is no longer truncated by default because streamed gen AI spans are not constrained by transaction size limits.
Gen AI spans are streamed by default, preventing them from being dropped when transaction payloads exceed size limits.
Gen AI message truncation is disabled by default when streamed Gen AI spans are enabled.
Streamed spans now use production as the default sentry.environment attribute value.
TwP sampling is deferred by reading trace state from the scope.
The ContextLines integration now uses dataCollection.frameContextLines.
dataCollection.httpBodies now defaults to all valid body types.
Primitive arrays are accepted as attribute values, while arrays with non-primitive elements are dropped; log and metric arrays are sent as actual arrays.
The Next.js project option type now accepts either a string or an array of strings.
Unwanted segments are filtered when span streaming is enabled.
Sentry now sets a global attribute indicating whether Turbopack is being used.
Discarded spans requiring a parent now emit a
no_parent_spanclient outcome.The google-genai integration no longer emits spans for chats.create.
Aligns Turbopack module metadata injection with webpack behavior, improving consistency for Next.js builds.
The Consola integration extracts the first-parameter object as searchable attributes.
A new page session lifecycle keeps the initial session across soft navigations until a hard refresh.
Capturing an exception with captureUnderscoreErrorException now exposes an event ID.
The Next.js integration now sets the Cloudflare runtime.
DebugID injection is turned off when sourcemaps are explicitly disabled, preventing unwanted instrumentation in that configuration.
Updates the default ignore list used for sourcemaps in Next.js projects.
DSNs can now use IPv6 hosts.
Scope attributes are now applied to metrics while the respective scopes are active; string, number, and boolean values are supported.
The Next.js integration now emits a warning when treeshaking and debug settings conflict.
Tracing and error monitoring now work automatically with Vercel AI SDK v6.
Cookie headers are now parsed into individual cookies.
The span attribute now contains only the GraphQL query string instead of the full JSON request payload.
Now supports GraphQL persisted operations by capturing the operation hash and protocol version as span attributes.
Inline media is stripped from tracing messages.
cacheComponents is now supported on Turbopack builds.
Next.js integrations add detection for Cloudflare's waitUntil capability.
Adds buffering for incoming client events.
Server-side transaction events now include the request URL, providing additional transaction context.
Request string inputs are truncated in the OpenAI integration to limit captured request data.
Spotlight is now included in development bundles, making development-time Spotlight functionality available by default.
The Next.js integration now deletes CSS map files.
Metrics are now enabled by default, although integrations do not automatically emit metrics.
The browser transport buffer is now limited in size.
Server SDK envelope requests now send a user-agent header.
AI integrations now truncate request messages, limiting the size of recorded request data.
Passes requestHook through to OpenTelemetry instrumentation.
Passes responseHook through to OpenTelemetry instrumentation.
Preparation for the Next.js 16 bundler default may affect bundler-related project decisions.
Tooling 5
Immutable browser chunks are now included in uploaded assets, improving source map or asset upload coverage for Next.js builds.
Published packages now include subpath type shims, improving type resolution for subpath imports.
Turbopack loaders now use the not: foreign condition.
Experimental support was added for using thirdPartyErrorFilterIntegration with Turbopack builds in Next.js 16+.
Next.js applications using Turbopack can use native Debug IDs for improved source map resolution and error tracking.
Fixes and other changes 83
HTTP spans named after the request method are detected correctly, improving HTTP span instrumentation.
Aligned tunnel request matching in middleware with the tunnel rewrite behavior.
Resolves the Next.js version relative to the SDK when the current working directory differs.
Sourcemap upload now includes only emitted chunk directories, preventing unrelated directories from being uploaded.
SDK imports no longer crash under jsdom or happy-dom environments.
Auto-instrumentation now supports OpenAI v7, allowing applications using that package version to be instrumented correctly.
Child span tracking is bounded on long-lived spans, preventing unbounded tracking over their lifetime.
Tracing is no longer added to middleware wrappers, preventing unintended tracing behavior.
Fixed a meriyah issue affecting standalone builds in Next.js.
Baggage with the string value undefined is no longer propagated when dynamic sampling context is missing.
The integration no longer causes infinite recursions.
Internal chunk frames are now marked as not in_app, improving frame classification in Next.js events.
Root spans created by Middleware.execute are now handled correctly when Next.js middleware runs on the Node.js runtime.
Inferred fragment attributes no longer retain a leading hash.
Inferred query attributes no longer retain a leading question mark.
Streamed span status messages are serialized to the sentry.status.message attribute.
Browser session envelopes are deferred until the browser is idle.
Trace meta tags are no longer injected when Next.js Cache Components is enabled.
Node runtime no longer fails when tracingChannel is unavailable.
Ensures url.full and http.url have identical values on client HTTP spans.
Avoids directly importing tracingChannel to maintain compatibility with Node v18.
Outgoing HTTP instrumentation no longer crashes when requests use
//paths.Safe random ID context is registered at module load to ensure it is available when needed.
Redirect server actions are marked as ok instead of internal_error.
pinoIntegration is now shimmed on the edge runtime, preventing edge-runtime integration issues.
__SENTRY_SERVER_MODULES__ is read lazily so Turbopack injection is honored.
Correctly parses sampleRate when consistent trace sampling is enabled.
DOMException instances with empty stack traces now receive a synthetic stack trace when attachStacktrace is enabled.
Internal frame detection is corrected for minified browser bundles, improving stack trace processing.
User data is no longer gated when streamed spans are read from scope.
Next.js build modification is skipped when SRI is enabled, preventing incompatible build changes.
Tunnel endpoint matching is narrowed to avoid matching endpoints too broadly.
GraphQL client spans are now enriched correctly when requests use relative URLs.
Outgoing request span attributes are now protected against null
httpVersionvalues.Implausible Largest Contentful Paint values are now filtered.
Promise rejection handling now records the rejection reason instead of the Promise as
originalException.Correlation handling now works correctly for stateless MCP wrapper transports.
Custom browser tracing setup is skipped for bot user agents.
Turbopack loaders now preserve directive prologues during processing.
MCP tool spans now receive error status when a tool returns a JSON-RPC error response.
Tracing now skips tunnel requests, preventing tunnel traffic from being included in application traces.
Logs the correct lastEventId when an error is thrown during component rendering.
Removes sourceMappingURL comments after source maps are deleted in Turbopack builds.
promiseBuffer is no longer removed entirely.
Trailing slashes are normalized in App Router route parameterization.
The environment from options is now applied when set.
SSR pages now return the correct last event ID.
Session user IDs are now consistently set, and the first soft navigation starts a new session correctly.
When enabled, spans no longer receive the sentry.drop_transaction attribute.
Non-transaction events now receive the parameterized transaction name.
The SENTRY_SERVER_MODULES value is now populated when using Turbopack.
Serverless environments receive fallback ALS runners.
Profiling debug ID matching is corrected.
Fetch options are shallow-cloned to prevent mutation.
IP address detection now finds the correct address regardless of case.
Vercel AI spans are detected by checking for the AI operation id.
Failed client reports no longer produce outcomes.
Client option types now allow explicitly passing undefined.
AI spans now receive operations when only a model ID is available.
Node-cron context is now passed through correctly.
Google GenAI tracing now includes the system prompt and model.
Anthropic AI message spans now include the system message.
Pino integration now supports the msg field, improving log capture for applications using Pino.
Vercel AI spans now include previously missing attributes.
Corrects the return type of beforeSendMetric.
Re-adds the _experiments.enableLogs option.
Fixes local-variable capture for out-of-app stack frames.
Applies maxValueLength when processing error messages.
The ISR route cache now uses an LRU map to manage cached routes.
Meta trace tags are dropped when the rendered page uses ISR.
Middleware files are no longer wrapped when Next.js runs in standalone mode.
Development error symbolication now respects the PORT environment variable.
Session status updates from events with exceptions now consider only the exception mechanism.
Replay ignores background-image when blockAllMedia is enabled.
Exception objects now include all keys instead of truncating them.
The Next.js integration stops accessing synchronous props in its template.
The Next.js proxy template wrapping was updated.
Corrected async types when instrumenting Anthropic's streaming API.
Removed chalk usage in Next.js integration to prevent runtime errors.
Bundler detection in the Next.js integration was updated.
The integration no longer sets the experimental instrumentation hook flag for Next.js 16.
Transaction naming for internationalized routing is now consistent.
Fixes route manifest creation when a basePath is configured.
@sentry/nextjs 93 changes
New APIs and options 1
An option was added to skip requestAnimationFrame for canvas snapshots.
Fixes and other changes 2
Logs no longer suffer flush timeout starvation during continuous logging.
Logs beyond MAX_LOG_BUFFER_SIZE are no longer swallowed.
@sentry/nextjs 83 changes
Behavior and default changes 1
The SDK now filters gmo errors and Facebook mobile errors.
Fixes and other changes 2
The install script again builds binaries from source, restoring successful installation behavior for profiling-related packages.
Performance measure spans now always have a positive duration.