[Solved] How to get clerk userId in a publicProcedure?

I need to get the authenticated user's id. I tried to use getAuth but I need to pass "req" as a parameter. Now the thing is, I don't have req in my publicProcedure. I only have input and ctx. Ctx only has prisma and input is just the input I passed to the query. Do you guys know how to get the authenticated userId???
4 Replies
whatplan
whatplan2y ago
use the clerkClient
whatplan
whatplan2y ago
Client | Clerk
The Client object tracks sessions, as well as the state of any sign in and sign up attempts.
Nemila
NemilaOP2y ago
Thank you but I tried and I couldn't get it to work Instead I found the solution the clerk doc
Nemila
NemilaOP2y ago
TRPC | Clerk
Learn how to integrate Clerk into your Next.js with TRPC
Want results from more Discord servers?
Add your server