Verify Webhook

When receiving a webhook from Loop, it is best if you verify its authenticity to prevent your application from receiving false information by malicious parties.

The verifyWebhook function in the SDK achieves this by checking the signature of the payload against the expected signature.


  • body (string): The payload of the webhook request.

  • signature (string): The signature of the webhook request.


  • A boolean indicating whether the signature of the webhook is valid or not.


const signature = request.headers["loop-signature"];
const validWebhook = loop.verifyWebhook(request.body, signature);
if (!validWebhook) {
    throw new Error("Invalid request signature");

Last updated