Skip to main content

Why Verify Signatures?

Webhook signatures ensure that the payload was sent by FoxReach and hasn’t been tampered with. Always verify signatures before processing webhook events.

How It Works

Each webhook has a unique secret that’s generated when the webhook is created. We use this secret to create an HMAC-SHA256 signature of the request body and include it in the X-Webhook-Signature header.

Verification Steps

1

Extract the signature

Get the X-Webhook-Signature header from the incoming request.
2

Compute the expected signature

Create an HMAC-SHA256 hash of the raw request body using your webhook secret.
3

Compare

Use a constant-time comparison to check if the signatures match.

Code Examples

Python

Node.js

Go

Always use constant-time comparison (like hmac.compare_digest in Python or crypto.timingSafeEqual in Node.js) to prevent timing attacks.