tRPCttRPC
Powered by
Stephane MS
tRPC•9mo ago•
1 reply
Stephane M

create middleware

Hi all,

still reading the docs since several hours, im kinda confused about the best way to create a middleware (in my case right now, for auth). some tutos show the t.middleware way, but docs show t.procedure.use(). are there some differences between the two we should be aware ?

also doc says
Creating middlewares using t.middleware has the limitation that the Context type is tied to the Context type of the tRPC instance.
Creating middlewares using t.middleware has the limitation that the Context type is tied to the Context type of the tRPC instance.


im not sure i fully understand what it means.

does anyone have some insight about this ?

(i am not using srr, just react with vite)

thank you 🙂
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

trpc middleware
PTIT-NeikkkPPTIT-Neikkk / ❓-help
3y ago
async middleware
BarakondaBBarakonda / ❓-help
3y ago