Middleware
The powerful and flexible way to reuse logic across procedures in oRPC.
Introduction
Middleware in oRPC is both powerful and flexible, enabling you to accomplish many tasks efficiently.
Typed Input
Middleware can expect specific input types, opening up many possibilities:
Concatenation
You can merge or extend middlewares using concatenation:
Extra Context
Extra context is created by middlewares and automatically merges with the global context, enhancing developer experience:
Fundamentals
In oRPC, middleware is simply a JavaScript function, making it easy to customize: