#godspeed-node-signatures
1 messages · Page 1 of 1 (latest)
hello, this is a common problem with node because most node web frameworks modify the incoming webhook request's body, where-as the constructEvent function needs the raw body from the request
you might have to try suggestions like this one: https://github.com/stripe/stripe-node/issues/1254#issuecomment-957788296
which exempt your webhook endpoint from any middleware modifications to the request body
Alright, I'll try to see if I can get it to work with thiis
I found a solution for SvelteKit Stripe integration. SvelteKit does modify the request body, so had to find a way to get the original raw body.
Solution:
const StripePayload = Buffer.from(request.rawBody);
and then use this in the stripe.webhooks.constructEvent method instead of solely using request.rawBody
Awesome! Is there anything else I can help you with?