Skip to content

Instantly share code, notes, and snippets.

@leonore
leonore / worker.js
Created July 10, 2024 15:27
incident.io CF worker Sentry Issue Alert transformer
export default {
async fetch(request, env, ctx) {
const headers = request.headers;
if (headers.get('Sentry-Hook-Resource') !== 'event_alert') {
return new Response('Not correct type', {
headers: { 'content-type': 'text/plain' },
status: 200,
});
}
const body = await request.json();