sentry-docs
sentry-docs copied to clipboard
Add more tunnel option examples for the JavaScript SDK
Core or SDK?
Platform/SDK
Which part? Which one?
JavaScript SDK
Description
https://docs.sentry.io/platforms/javascript/troubleshooting/#using-the-tunnel-option
We have a tunnel option exposed in the SDK to help users deal with ad-blockers. There are some improvements we can make to the documentation around this.
Suggested Solution
- We should create more server-side code examples (currently we only have PHP and dotnet).
- Tim has a great snippet using cloudflare workers (JS): https://gist.github.com/timfish/a69dd7457b8d6d97c0a8018675be6c23
- Vladan did the same for NextJS: https://gist.github.com/vladanpaunovic/5ae6ef04ff5473dbf8ebbd82e01e67aa
- A Python and Ruby example + both of the JS ones above probably bring us to a good place
- We should also think about moving it outside the troubleshooting section so it is visible to more users. Open to feedback around this.
Also note that there's a link to the examples doc:

Which we can add more examples and includes an easy to run JS example consuming the tunnel:
https://github.com/getsentry/examples/tree/master/tunneling
We do have a ruby snippet, but it's formatted weirdly (see https://github.com/getsentry/sentry-docs/issues/5281). And yes, agree we need a Python example.