Skip to main content

Verify Webhook Signatures

Signature header

Brale signs webhook deliveries with HMAC-SHA256. Each request includes:
The signature is computed over the exact raw request body bytes. Signature verification details:
  • The header value is the lowercase hex-encoded HMAC-SHA256 digest (no prefix like v1=, no version, no timestamp).
  • The HMAC is computed over the exact raw request body bytes (no canonicalization).
  • The HMAC key is the Base64URL-decoded sharedSecret value returned when creating the subscription.

Shared secret

When you create a webhook subscription, Brale returns a sharedSecret.
This value is Base64URL encoded. Decode it before using it as the HMAC key. Do not use the encoded string directly as the HMAC key.

Node.js / TypeScript example

Express example

Mount the webhook route with express.raw() before express.json().

Python example

Common signature verification failures