This is a Worker to send sentry.io events into a Discord Channel. At the time of writing, Sentry didn’t provide native integration with Discord. You might want to double-check if native functionality is available.

The GitHub project is available here.

copy paste installation Link to heading

  • create a new Cloudflare worker
  • copy and paste the contents of index.js into the quick edit editor, save and deploy
  • open the Cloudflare Workers settings page and add a new Environment Variable

Use WEBHOOK for the VARIABLE_NAME and the generated Discord webhook URL for the Value

wrangler installation Link to heading

if you’re using wrangler already, here’s how to do this with wrangler:

  • update wrangler.toml with your own Cloudflare Account ID (replace <YOUR ACCOUNTID>), you can find your account ID in the Cloudflare Workers dashboard
  • publish the Worker with wrangler
    • wrangler publish
  • create the WEBHOOK secret with wrangler
    • wrangler secret put WEBHOOK and add your discord webhook url in there

sentry configuration Link to heading

  • go ahead and configure sentry to send events to your workers script, for example: https://super-worker.awesomesauce.workers.dev/