#saiki_webhooks
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1418347200706117815
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi @native wind, I'd like to know if there is a way to replicate this rawBody rule in nodejs. I'm having a hardtime checking the signature because im not able to get the expected rawBody
Hi there!
Hi!
Do you mean you're writing a webhook handler in node.js and you are asking how to make sure you have the raw body of the event? If yes, most people doing servers in node are using express and use the express.raw method
We have a webhook builder tool which I would recommend starting with
Yes, and it didn't work because of some authorization matters
because the proxy would handle the auth
What information do you have for debugging? What kind of errors do you have, etc? An example webhook event might also help
can you see a lipeefsilva_webhooks topic in the #dev-help channel?
it had a lot of data written
but was closed for somereason
i'm there, too
this one
We always close threads when they become inactive for a certain time
I'm reading your previous thread
Ok, thanks
hey @native wind i think i had progress with the link you sent about the webhook builder
these are the new conditions:
(full file code attached)
output
now the buffer looks more like expected
I am sure that the secret is correct, and the signature provided is also in the expected format
Also, the body is being shown as a buffer
I'm not quite sure what is different
My assumption is that something is modifying the request body
possibly the API Gateway?
Do you know of a way I could work around that?
like possibly checking in another way or replicating what the body mapping template would be doing
in this github issue which one of my teammates answered, the asker eventually fixed their issue and said this:
I'm using Serverless, and needed to redeploy my whole stack. You'll have to do similar with whatever tool you're using to get API gateway to send the rawbody attribute (this didn't seem necessary for me for other mappings like IP address, so not sure whats going on)
did you do anything like that after adding the body mapping template?
Let me try that again. In the first try it failed because of the authentication middleware
also are you using the signing secret you get from the dashboard, or the CLI?
๐ Taking over this thread, catching up now
Are you forwarding the event to your server endpoint using the CLI?
Or do you receive the event directly with the endpoint set up directly in the Dashboard?
If you spin up the simple express server with the same code, and forward event to this server, will that work?
Let me try that
If this approach works, then the issue isn't likely due to the code, but the config in API Gateway
In this case, we can conclude that the issue is likely stemmed from the API Gateway that the event might have been modified and no longer in the raw form
i'm having a hard time even following those instructions
Did you manage to resolve the authentication failure with the template content suggested in the doc
Hi, I'll be logging off but be back tomorrow morning to work on this
thank you guys for all the help
No problem! Happy to help ๐