Stephane MS
tRPC8mo 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.


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 🙂
Was this page helpful?