Skip to content
PreviewNot live yet. APIs and SDKs on these pages may change before launch.

Verify webhooks

MailPidge follows Standard Webhooks, so any Standard Webhooks library works.

Header Value
webhook-id Delivery id (dwd_…), same on every retry
webhook-timestamp Unix seconds of this attempt
webhook-signature v1,<base64>; two space-separated values during rotation

Verify against the raw body, not a re-serialized one.

import { verifyWebhookRequest } from '@mailpidge/sdk'
const body = await request.text()
const isValid = await verifyWebhookRequest({
headers: request.headers,
body,
secret: process.env.MAILPIDGE_WEBHOOK_SECRET!,
})
if (!isValid) return new Response('invalid signature', { status: 401 })

After Rotate secret, requests carry both signatures for 72 hours.