Clerk Webhook Input Undefined
Hi! I wrote a public procedure that takes in an input and updates user info based on Clerk Webhook. Clerk correctly pings the endpoint and the logic in the endpoint gets executed, but the input is undefined. I tried to ping the endpoint from postman with a request body. The request goes through but the input still says it's undefined.
8 Replies
postman request
Which adapter/integration are you using to run tRPC? Is it possible a middleware is messing with what arrives at tRPC?
I've seen issues with common express middlewares being placed before the tRPC integration
I'm using superjson as the transformer. And the project is from the t3-turbo-clerk template. All the other endpoints work perfectly as expected when called using useQuery from the frontend. The problem seems to be only happening when the request comes from an external source (the clerk webhook in this instance)
Fixed: I am new to trpc and didn't realize trpc endpoints aren't rest endpoints. Using trpc-openapi solved the issue
Thanks for posting this. I'm running into the same issue right now. We are also using the t3-turbo-clerk template.
In my case, I just trying to call an TRPC api endpoint directly without going through our Next.js frontend. I tried using Postman to call the TRPC endpoint and send data through request body, but the
input
param continue to be undefined like you mentioned.
If I understood what you said above, does that mean whenever we make an external call to a TRPC endpoint, we need to use trpc-openapi
?Yes you’re correct
Gotcha. Thank you so much!