Verify Webhooks
Verify webhook signatures with HMAC-SHA256
Verify webhook signatures with HMAC-SHA256
The SDK’s validateWebhook() verifies the HMAC signature, checks timestamp freshness, and returns a typed event object:
The SDK uses the Web Crypto API internally, so validateWebhook() works in Node.js, Deno, Bun, and edge runtimes.
Every webhook includes an X-Gwop-Signature header:
t — Unix timestamp when the webhook was sentv1 — HMAC-SHA256 of {timestamp}.{raw_body} using your webhook secretIf you’re not using the SDK, verify signatures manually:
timingSafeEqual (or the SDK), never === for HMAC comparisonX-Gwop-Event-Id — The same event may be delivered multiple times; store processed event IDsYou must use the raw body (req.body.toString() or express.raw()) for HMAC verification. If you parse the body as JSON first and re-stringify it, the signature won’t match due to whitespace or key ordering differences.