Skip to content

Commit 7d092a5

Browse files
author
Luca Forstner
authored
Add description for Next.js SDK tunnelRoute option (#5957)
1 parent aab282f commit 7d092a5

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/platforms/javascript/guides/nextjs/manual-setup.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ const moduleExports = {
167167
// 'Configure Serverside Auto-instrumentation':
168168
// - autoInstrumentServerFunctions
169169
// - excludeServerRoutes
170+
// 'Configure Tunneling to avoid Ad-Blockers':
171+
// - tunnelRoute
170172
},
171173
};
172174

@@ -391,3 +393,25 @@ const moduleExports = {
391393
```
392394

393395
Excluded routes can be specified either as regexes or strings. When using a string, make sure that it matches the route exactly, and has a leading slash but no trailing one.
396+
397+
## Configure Tunneling to avoid Ad-Blockers
398+
399+
_(New in version 7.26.0)_
400+
401+
You might notice that Sentry events are sometimes blocked by Ad-Blockers.
402+
Ad-blockers can be circumvented by using **tunneling**.
403+
404+
The Sentry Next.js SDK provides an easy way to set up tunneling for your application.
405+
Use the `tunnelRoute` option in the `sentry` object in your `next.config.js` to provide a route the SDK will use to tunnel events to Sentry:
406+
407+
```javascript {filename:next.config.js}
408+
const moduleExports = {
409+
sentry: {
410+
tunnelRoute: "/monitoring-tunnel",
411+
},
412+
};
413+
```
414+
415+
Please note that this option will tunnel Sentry events through your Next.js application so you might experience increased server usage.
416+
417+
Learn more about tunneling in the <PlatformLink to="/troubleshooting/#dealing-with-ad-blockers">troubleshooting section</PlatformLink>.

0 commit comments

Comments
 (0)