> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sendpadi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Verifying webhooks

> Verify X-SendPadi-Signature on inbound webhooks.

# Verifying webhooks

```javascript theme={null}
import crypto from 'crypto';

function verify(rawBody, signatureHeader, secret) {
  const expected = crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
  return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(signatureHeader));
}
```

Always verify using the **raw request body** bytes, not a re-serialized object.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.