Repository navigation
feat(v10/nextjs): Add a tunnel route handler that sends only the event payload to Sentry - #25559
Merged
Merged
Conversation
…t payload to Sentry Backport of: #25456
s1gr1d
marked this pull request as ready for review
October 20, 2026 13:51
s1gr1d
requested review from
chargome,
logaretm and
nicohrubec
and removed request for
a team
October 20, 2026 13:51
nicohrubec
approved these changes
Oct 20, 2026
Merged
1 of 6 tasks
Contributor
size-limit report 📦
|
logaretm
approved these changes
Oct 20, 2026
51 tasks
s1gr1d
added a commit
to getsentry/sentry-docs
that referenced
this pull request
Oct 27, 2026
#20075) ## DESCRIBE YOUR PR Documents the tunnel changes in SDK 11.9.0.⚠️ Merge this PR only after 10.77.1 and 11.9.0 are released. - Next.js `tunnelRoute`: add handler mode (`app/sentry-tunnel/route.ts`). In this mode, a route handler in the app forwards only the request body to Sentry. Rewrite mode now sends with `credentials: "omit"`. Apps behind Vercel Deployment Protection or another login should use handler mode. - Troubleshooting: list what a custom tunnel must do, add `handleTunnelRequest`, and add a new "Credentials on Tunnel Requests" entry. - Short notes in `options.mdx`, the getting-started includes, the Next.js setup pages, and TanStack Start. Related SDK PRs, all going to be released in **11.9.0**: - getsentry/sentry-javascript#25456 - getsentry/sentry-javascript#25515 - getsentry/sentry-javascript#25509 Backport PRs for **10.77.1**: - getsentry/sentry-javascript#25559 - getsentry/sentry-javascript#25560 - getsentry/sentry-javascript#25561 ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. Select exactly one option. For deadlines, replace `YYYY-MM-DD` with the due date. You can update this information later by editing the PR description. - [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD - [x] Other deadline: with the 11.9.0 release - [ ] No deadline: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've supplied a deadline. Thanks in advance for your help! ## PRE-MERGE CHECKLIST _Make sure you've checked the following before merging your changes:_ - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of: #25456
Differences to the original PR
src/server/index.ts,src/edge/index.ts: addsgetTunnelRouteIgnoreSpans()to the localnextjsIgnoreSpansarrays, because v10 has noNEXTJS_SERVER_IGNORE_SPANS.src/config/withSentryConfig/getFinalConfigObjectUtils.ts: logs withconsole.log/console.warnand skips the output withsilent, because v10 has nogetBuildLogger(fix(nextjs): Applysilentto the SDK's own build logs #23621).src/common/utils/dropMiddlewareTunnelRequests.ts,src/common/utils/tunnelPathnameMatch.ts: keeps the v10 code (isSentryRequestSpan,isSentryTunnelRequest) and adds only the new functions. The middleware skip of v10 does not change: in handler mode the client posts to the bare path, so the skip does not apply and the user's middleware runs, as on v11.src/common/wrapMiddlewareWithSentry.ts(v10 only): on Next.js 13, the wrapper starts the middleware span itself, and the span has no request target, so the newignoreSpansentries cannot match it. In handler mode, the wrapper now setssentry.drop_transactionon this span for tunnel requests. The middleware still runs.src/config/types.ts: the middleware paragraph starts with "With this handler", because in rewrite mode v10 still skips the middleware for tunnel requests.nextjs-16-tunnel: the handler test without server spans checks transactions, because v10 uses the static lifecycle by default.@sentry/conventionsis0.16.0, the version of v10. Playwright and@sentry-internal/test-utilskeep the v10 versions.CHANGELOG.md: the entry is under "Unreleased", with one more sentence about middleware.