Receive webhooks reliably and verify their signatures
8 steps · about 1 h 19 min · Intermediate
- Learn how webhooks push events to your server (reference, GitHub Docs, 5 min)
Sets out the delivery model you are building for.
- Create and test a webhook endpoint for payment events (reference, Stripe, 15 min)
A full endpoint walkthrough including local testing.
- Validate an HMAC SHA-256 signature on each delivery (reference, GitHub Docs, 10 min)
Shows constant-time comparison with code in several languages.
- Reject replayed events using signed timestamps (reference, Stripe, 8 min)
Adds the tolerance window that stops replay attacks.
- Follow the Standard Webhooks signing specification (reference, Standard Webhooks, 15 min)
Gives a vendor-neutral format for IDs, timestamps and signatures.
- Verify payloads against the raw request body (guide, Svix, 8 min)
Explains why parsed JSON breaks signatures and how to avoid it.
- Respond fast and process deliveries in the background (reference, GitHub Docs, 8 min)
Covers timeouts, queuing and handling redelivery.
- Deduplicate retried deliveries by event ID (reference, Shopify, 10 min)
Shows how a large platform retries and how to ignore repeats.