Skip to content
masterclass Buddy

T3 Stack · Method

.use

The tRPC .use method attaches middleware to a procedure. Middleware can check context, reject a request, or pass a narrowed context to the next step.

Last updated

Syntax

t.procedure.use(({ ctx, next }) => next({ ctx }))

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • tRPC
  • protectedProcedure
  • TRPCError
  • createTRPCContext
  • session
  • middleware

Source: tRPC • Create T3 App. Checked 2026-11-03.