Overview
These API's are still undergoing stabilisation. Feel free to use them but they will likely change in the future updates!
rspc allows adding middleware to your router which can intercept the request and response for procedures defined after it on the router. Middleware can also modify the context type which is passed to future procedures which is super powerful.
The middleware APIs are still fairly new. Better documentation will come in the future once they are more stable.
Context switching
Middleware are allowed to modify the context. This includes being able to change it's type. All operations below the middleware in the router will receive the new context type.
Examples
Logger middleware
Authentication middleware
Reject all middleware
Edit on GitHub
Last updated on