#luddilo-webhook-events

1 messages · Page 1 of 1 (latest)

lucid stone
scenic agate
#

I've seen various attempts using various Buffer methods but nothing seems to work for me..

lucid stone
#

Hi again 👋 I'm less familiar with handling these in a lambda function and would need to do some digging.

lucid stone
scenic agate
#

What I found out is that in my deployed environment, the body is a Base64 encoded string. In my local dev environment I get a JSON. In order to get the same JSON in the deployed environment I can do:

event = JSON.parse(Buffer.from(lambdaEvent.body, 'base64').toString())

This gives the same error however

#

Hmm. Maybe I have to do the same for the sig from headers aswell.. I'll try that next

remote sleet
#

The signature verification takes three inputs: the request body, the signature header and the webhook secret

#

The latter two can be verified by debugging and checking config to ensure the correct values are passed in

#

but the body is tricky because it's critical to use the raw request body

#

You cannot pass in parsed json etc -- it must be the raw string from the request (whitespace and all)