The TypeScript, Python, and Go SDKs ship a Webhook helper that verifies the signature, enforces a 5-minute timestamp tolerance, and returns the parsed event. Hand it the raw request body — re-stringified JSON breaks the signature. Keep receiver logs bounded to delivery status and event type; avoid logging event IDs or payload data unless you redact them first.
import express from 'express'import { Webhook, WebhookVerificationError } from 'casedev/webhooks'const app = express()const wh = new Webhook(process.env.CASEDEV_WEBHOOK_SECRET!)app.post('/webhooks/casedev', express.raw({ type: 'application/json' }), (req, res) => { try { const event = wh.verify(req.body, req.headers) console.info('case.dev webhook received', { type: event.type }) if (event.type === 'vault.ingest.completed') { // Trigger internal work from event.data here; do not log the payload directly. } return res.sendStatus(204) } catch (err) { if (err instanceof WebhookVerificationError) return res.status(400).send(err.code) throw err }})
Start with exact event names, then widen to patterns like vault.* after your receiver is stable. Use Event types for the generated event list and API reference for endpoint update, replay, and rotation APIs.