
We are going to use the Svix open-source library to verify webhooks. First, install the relevant libraries for your language:Next, verify webhooks using the code below. The payload is the raw (string) body of the request, and the headers are the headers passed in the request.Remember to get the signature secret from the endpoint details in the console.
You need to use the raw request body when verifying webhooks, as the cryptographic signature is sensitive to even the slightest changes. Watch out for frameworks that parse the request as JSON and then stringify it, as this will break the signature verification.See examples below for how to get the raw request body with different frameworks.