Repository navigation
docs(js): Document the managed tunnel and serveTunnelIntegration #20264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
logaretm
wants to merge
17
commits into
master
Choose a base branch
from
awad/managed-tunnel-docs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+910
−1,337
Draft
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
c284811
docs(js): Document the managed tunnel and serveTunnelIntegration
logaretm 56f876d
docs(js): Document serving the managed tunnel on any server
logaretm 552e8be
docs(js): Align the managed tunnel docs with the 11.10.0 release
logaretm 2807cbe
docs(js): Hide the managed tunnel docs from Next.js for now
logaretm f5d4bf8
docs(js): Align the tunnel endpoint rules with handleTunnelRequest
logaretm cd71dcf
docs(js): Keep the handleTunnelRequest paragraph, with the non-deprec…
logaretm 26dd854
docs(js): Link browser-only platforms to the Node.js serveTunnel page
logaretm 809d61f
docs(js): Document only the middleware for serving the tunnel yourself
logaretm ebe5801
docs(js): Document handleTunnelRequest for a fixed tunnel path
logaretm c246c5e
docs(js): Apply the docs style guide to the managed tunnel docs
logaretm 9efd075
docs(js): Clarify that serveTunnelIntegration needs a request hook to…
logaretm 17286bd
docs(js): Show per-platform tunnel serving notes instead of listing e…
logaretm e33f929
docs(js): Move tunneling docs to their own configuration page
logaretm b9425c4
docs(js): Document the managed tunnel served by the runtime
logaretm d08f9da
docs(js): Fix the tunnelRoute note and mark fixed tunnel paths as 11.…
logaretm b758cac
docs(js): Link the Next.js Cloudflare quick start to the Tunneling page
logaretm acacaef
docs(js): Link Cordova tunnel option to the JavaScript Tunneling page
logaretm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
81 changes: 81 additions & 0 deletions
81
docs/platforms/javascript/common/configuration/integrations/servetunnel.mdx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| --- | ||
| title: ServeTunnel | ||
| description: "Serves a tunnel on your server so Sentry browser SDK events reach Sentry through your own origin, past ad blockers." | ||
| supportedCategories: | ||
| - server | ||
| --- | ||
|
|
||
| <PlatformSection notSupported={["javascript.nextjs"]}> | ||
|
|
||
| <AvailableSince version="11.12.0" /> | ||
|
|
||
| </PlatformSection> | ||
|
|
||
| <PlatformSection supported={["javascript.nextjs"]}> | ||
|
|
||
| <AvailableSince version="11.13.0" /> | ||
|
|
||
| </PlatformSection> | ||
|
|
||
| _Import name: `Sentry.serveTunnelIntegration`_ | ||
|
|
||
| This integration serves the tunnel that the browser SDK uses when you set `tunnel: true`. The tunnel forwards the browser's events to Sentry, so ad blockers don't drop them. To set it up, see <PlatformLink to="/configuration/tunneling/">Tunneling</PlatformLink>. | ||
|
|
||
| ```javascript | ||
| Sentry.init({ | ||
| dsn: "___PUBLIC_DSN___", | ||
| integrations: [Sentry.serveTunnelIntegration()], | ||
| }); | ||
| ``` | ||
|
|
||
| ## Options | ||
|
|
||
| Most apps don't need any of these options. | ||
|
|
||
| ### `allowedDsns` | ||
|
|
||
| _Type: `string[]`_ | ||
|
|
||
| DSNs to forward besides the server's own. Use this when the browser uses a different DSN than the server. The server's own DSN is always allowed. | ||
|
|
||
| ```javascript | ||
| Sentry.serveTunnelIntegration({ | ||
| allowedDsns: ["___PUBLIC_DSN___"], | ||
| }); | ||
| ``` | ||
|
|
||
| ### `path` | ||
|
|
||
| _Type: `string`_ | ||
|
|
||
| A fixed tunnel path instead of the one derived from the DSN. The SDK serves it as written, without the base path. Set the same path in the browser, as described in <PlatformLink to="/configuration/tunneling/#using-a-fixed-path">Using a Fixed Path</PlatformLink>. | ||
|
|
||
| ### `basePath` | ||
|
|
||
| _Type: `string`_ | ||
|
|
||
| The path prefix your app is served under, for example `/docs`. The SDK reads it from your framework config, so you only need this option when it can't. Set the same value in the browser `tunnel` option. | ||
|
|
||
| ### `intercept` | ||
|
|
||
| _Type: `boolean`_ | ||
| _Default: `true`_ | ||
|
|
||
| Whether the SDK answers tunnel requests before they reach your app. Set it to `false` to answer them from your own code with `handleTunnelRequestIfMatched`, for example behind your own middleware. Tunnel requests still don't show up in your traces: | ||
|
|
||
| ```javascript | ||
| import express from "express"; | ||
| import * as Sentry from "@sentry/node"; | ||
|
|
||
| const app = express(); | ||
|
|
||
| app.use( | ||
| (req, res, next) => Sentry.handleTunnelRequestIfMatched(req, res) ?? next() | ||
| ); | ||
| ``` | ||
|
|
||
| <PlatformSection supported={["javascript.nextjs"]}> | ||
|
|
||
| On Vercel, the route that `withSentryConfig` adds at build time still answers tunnel requests. | ||
|
|
||
| </PlatformSection> |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.