This example shows how you can use a Cloudflare Worker to proxy events to Sentry from any SDK but most useful for the tunnel
option in the JavaScript SDK.
- Create a new Cloudflare Worker from your Cloudflare dashboard
- Replace the example worker code with the contents of the
worker.js
file - Update the
SENTRY_DSN_WHITELIST
and/orSENTRY_HOST_WHITELIST
with all the DSN's or hosts that are allowed to be proxied - (optional) Update
PROXY_PATHNAME
with the path you want the proxy to operate on, be careful to not use "sentry" or another keyword here that might trigger an adblocker, keep it simple