When I use req.json() (similar to the next.js example) the API throws right away.
When I use req.text() (similar to the node.js example) like in the example below, it shows that the request body is empty and then throws when I try to use JSON.parse()
The webhook is correctly calling this handler and passing the correct headers but it seems like it's not passing any data in the request body.
I have tried to debug this for hours, I'd really appreciate some help.
I am following the docs and example codebase but the webhook is not working as intended.
doc: https://portal.thirdweb.com/connect/pay/webhooks example: https://github.com/thirdweb-dev/direct-payments-example/blob/main/src/app/api/route.ts
When I use
req.json()
(similar to the next.js example) the API throws right away.When I use
req.text()
(similar to the node.js example) like in the example below, it shows that the request body is empty and then throws when I try to useJSON.parse()
The webhook is correctly calling this handler and passing the correct headers but it seems like it's not passing any data in the request body.
I have tried to debug this for hours, I'd really appreciate some help.
Thank you
next.js webhook route handler:
Pay embed UI configuration: