Skip to content

Add description for Next.js SDK tunnelRoute option #5957

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

Merged
merged 3 commits into from
Dec 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/platforms/javascript/guides/nextjs/manual-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ const moduleExports = {
// 'Configure Serverside Auto-instrumentation':
// - autoInstrumentServerFunctions
// - excludeServerRoutes
// 'Configure Tunneling to avoid Ad-Blockers':
// - tunnelRoute
},
};

Expand Down Expand Up @@ -391,3 +393,25 @@ const moduleExports = {
```

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.

## Configure Tunneling to avoid Ad-Blockers

_(New in version 7.26.0)_

You might notice that Sentry events are sometimes blocked by Ad-Blockers.
Ad-blockers can be circumvented by using **tunneling**.

The Sentry Next.js SDK provides an easy way to set up tunneling for your application.
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:

```javascript {filename:next.config.js}
const moduleExports = {
sentry: {
tunnelRoute: "/monitoring-tunnel",
},
};
```

Please note that this option will tunnel Sentry events through your Next.js application so you might experience increased server usage.

Learn more about tunneling in the <PlatformLink to="/troubleshooting/#dealing-with-ad-blockers">troubleshooting section</PlatformLink>.