Why webhooks does not work with TRPC?
I have a what suppose to be a webhook:
When I POST to this endpoint it responds with:
Why?
console logs undefined on the server.
5 Replies
It’s because you have a transformer set up, that’s the transformer format
well, same thing without transformer:
this is how I handle my stripe webhook, the body is somewhere is request you'll have to figure it out
Undefined keys get dropped from normal JSON serialisation, so that also looks correct
You haven’t said if you’re posting any body to the mutation, so I have to assume it’s just a straight post
actually it's working, all good
I've been posting to this endpoint without
content-type: application/json
header before.