Skip to content

Commit 3574e32

Browse files
committed
docs(js): Show per-platform tunnel serving notes instead of listing every framework
1 parent 0e472c1 commit 3574e32

2 files changed

Lines changed: 48 additions & 4 deletions

File tree

‎docs/platforms/javascript/common/configuration/integrations/servetunnel.mdx‎

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,29 @@ Sentry.init({
3232

3333
The browser and the server both derive the tunnel path from the DSN, for example `/qpo967`. You don't need a route file, a build step, or an environment variable. If your app is served under a base path, the SDK adds it on both sides.
3434

35-
The integration doesn't handle requests by itself. The SvelteKit, Nuxt, Nitro, Astro, React Router (framework mode), TanStack Start, and Remix 3 SDKs serve the tunnel from their request hooks. On other servers, like Express, Fastify, Bun, Deno, or Cloudflare Workers, [serve it yourself](#serving-the-tunnel-yourself).
35+
<PlatformSection supported={["javascript.sveltekit", "javascript.nuxt", "javascript.nitro", "javascript.astro", "javascript.tanstackstart-react"]}>
36+
37+
The SDK serves the tunnel from its request hooks, so this is all the setup you need.
38+
39+
</PlatformSection>
40+
41+
<PlatformSection supported={["javascript.react-router"]}>
42+
43+
In framework mode, the SDK serves the tunnel from its request hooks, so this is all the setup you need.
44+
45+
</PlatformSection>
46+
47+
<PlatformSection supported={["javascript.remix"]}>
48+
49+
On Remix 3, the SDK serves the tunnel from its request hooks, so this is all the setup you need. On earlier versions, [serve it yourself](#serving-the-tunnel-yourself).
50+
51+
</PlatformSection>
52+
53+
<PlatformSection notSupported={["javascript.sveltekit", "javascript.nuxt", "javascript.nitro", "javascript.astro", "javascript.tanstackstart-react", "javascript.react-router", "javascript.remix"]}>
54+
55+
The integration doesn't handle requests by itself, so you need to [serve the tunnel yourself](#serving-the-tunnel-yourself).
56+
57+
</PlatformSection>
3658

3759
<PlatformSection supported={["javascript.cloudflare"]}>
3860

@@ -110,7 +132,7 @@ The path prefix your app is served under, for example `/docs`. The SDK reads it
110132
111133
## Serving the Tunnel Yourself
112134
113-
On servers without a framework SDK hook, like Express, Fastify, `node:http`, Bun, or Deno, mount `handleTunnelRequestIfMatched` before your routes and body parsers. It forwards tunnel requests and returns `undefined` for everything else:
135+
On servers without a framework SDK hook, mount `handleTunnelRequestIfMatched` before your routes and body parsers. It forwards tunnel requests and returns `undefined` for everything else:
114136
115137
```javascript {tabTitle:Express}
116138
const express = require("express");

‎docs/platforms/javascript/common/troubleshooting/index.mdx‎

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ You can work around our CDN bundles being blocked by [using our NPM packages](#u
228228

229229
<AvailableSince version="11.10.0" />
230230

231-
The SDK can serve the tunnel for you. Set `tunnel: true` in your browser `Sentry.init`, and add `serveTunnelIntegration` to your server `Sentry.init`:
231+
Set `tunnel: true` in your browser `Sentry.init`, and add `serveTunnelIntegration` to your server `Sentry.init`:
232232

233233
```javascript {tabTitle:Browser}
234234
Sentry.init({
@@ -246,14 +246,36 @@ Sentry.init({
246246

247247
The browser then sends its events to a path on your own origin derived from the DSN, and your server forwards them to Sentry.
248248

249-
The SvelteKit, Nuxt, Nitro, Astro, React Router (framework mode), TanStack Start, and Remix 3 SDKs serve the tunnel for you and read your app's base path from your framework config. On other servers, like Express, mount `handleTunnelRequestIfMatched` before your routes and body parsers:
249+
<PlatformSection supported={["javascript.sveltekit", "javascript.nuxt", "javascript.nitro", "javascript.astro", "javascript.tanstackstart-react"]}>
250+
251+
The SDK serves the tunnel for you and reads your app's base path from your framework config.
252+
253+
</PlatformSection>
254+
255+
<PlatformSection supported={["javascript.react-router"]}>
256+
257+
In framework mode, the SDK serves the tunnel for you and reads your app's base path from your framework config. In other modes, see <PlatformLink to="/configuration/integrations/servetunnel/#serving-the-tunnel-yourself">Serving the Tunnel Yourself</PlatformLink>.
258+
259+
</PlatformSection>
260+
261+
<PlatformSection supported={["javascript.remix"]}>
262+
263+
On Remix 3, the SDK serves the tunnel for you and reads your app's base path from your framework config. On earlier versions, see <PlatformLink to="/configuration/integrations/servetunnel/#serving-the-tunnel-yourself">Serving the Tunnel Yourself</PlatformLink>.
264+
265+
</PlatformSection>
266+
267+
<PlatformSection notSupported={["javascript.sveltekit", "javascript.nuxt", "javascript.nitro", "javascript.astro", "javascript.tanstackstart-react", "javascript.react-router", "javascript.remix"]}>
268+
269+
The integration doesn't handle requests by itself. Mount `handleTunnelRequestIfMatched` on your server, before your routes and body parsers:
250270

251271
```javascript {filename:Server}
252272
app.use(
253273
(req, res, next) => Sentry.handleTunnelRequestIfMatched(req, res) ?? next()
254274
);
255275
```
256276
277+
</PlatformSection>
278+
257279
<PlatformCategorySection supported={["server"]}>
258280
259281
See <PlatformLink to="/configuration/integrations/servetunnel/">`serveTunnelIntegration`</PlatformLink> for a fixed path, more allowed DSNs, and how the tunnel handles requests. If you can't use the managed tunnel, set up your own tunnel as explained below.

0 commit comments

Comments
 (0)