Webhook Verification
Validate raw signed deliveries before updating local state
Webhook handling should be intentionally strict: verify first, then trust the payload.
Why this pattern
- the SDK checks HMAC signature and timestamp freshness
- the app preserves the exact raw request body for verification
- downstream handlers switch on a typed
eventType - local state changes happen only after signature validation succeeds
Recommended shape
Do not parse and re-stringify the JSON before verification. The signature is computed over the original raw request body bytes.