Webhooks are beautiful, but sometimes hard. Especially when using the security features
I spent a couple of hours trying to figure out why I couldn’t get the Typeform webhook signature to work - so I wrote a whole post explaining how I could debug and resolve the problem!
This uses:
- Typeform: the source <3
- Ngrok: to set up a proxy between the web and my machine
- Fastify: node js backend library
- Dashcam: to debug and create videos
https://dev.to/orliesaurus/debugging-typeform-webhooks-2m7j
TL;DR: There is an extra character in the signature calculation that you need to add
Here’s the code that fixes it!
if (verifySignature(signature,`${JSON.stringify(request.body)}\n`)) {
reply.code(200).send({ status: 'ok' });
return
}
I am happy to answer any questions about the article, the method I used to debug the signature and anything else!