#Monimolimnion
1 messages ยท Page 1 of 1 (latest)
This is just from my local development server btw
nvm, somehow my secret key env variable got deleted ๐ซฃ
All set now then?
I have a new issue actually
Webhook payload must be provided as a string or a Buffer (https://nodejs.org/api/buffer.html) instance representing the _raw_ request body.Payload was provided as a parsed JavaScript object instead.
You need to ensure you provide the raw request body string that was sent, not parsed json
hmm
If you have express/bidy-parser set up to parse request payloads as json you'll need to exclude the webhook endpoint from that, or otherwise preserve the raw body string
I'm not parsing anything as JSON
unless Sveltekit is doing it without my knowledge
That's very possible, I've not sure how that framework works
I've seen const payload = Buffer.from(request.body) suggested
but then I get TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of ReadableStream
ah, got it I think
const payload = await request.text()
for future reference ๐