Courier's proxy runs behind one route of your app. An official adapter mounts it in your framework: install its package and add that route. The handler takes no arguments, because it reads the sources the app registered, so moving to another framework changes only the import and the one call.
Full-stack frameworks
The proxy lives in an API route of the app itself, and Courier's plugin, from the package's /plugin entry, gives its pages their routes — see the plugin for your build.
| Framework | Package | Route | The pages' routes | Guide |
|---|---|---|---|---|
| Next.js | @noverax/courier-next | app/api/request/route.ts | withCourier() around next.config | Next.js |
| Nuxt | @noverax/courier-nuxt | server/api/request.ts | courierRoutesModule in modules | Nuxt |
| SvelteKit | @noverax/courier-sveltekit | src/routes/api/request/+server.ts | courierRoutes() in Vite's plugins | SvelteKit |
| Astro | @noverax/courier-astro | src/pages/api/request.ts | courierRoutesIntegration() in integrations | Astro |
| Remix & React Router | @noverax/courier-remix | app/routes/api.request.ts | courierRoutes() in Vite's plugins | Remix & React Router |
| SolidStart | @noverax/courier-solid | src/routes/api/request.ts | courierRoutes() in Vite's plugins | SolidStart |
| TanStack Start | @noverax/courier-tanstack-start | src/routes/api/request.ts and src/routes/api/sse.ts | courierRoutes() in Vite's or Rsbuild's plugins | TanStack Start |
Server frameworks
The proxy is one route of your server. The pages that call it take their routes from Courier's plugin in the build that makes them — the React and Vue guides show it — or from courier.routes.ts, which Courier writes for pages no bundler builds.
| Framework | Package | Mounted with | Guide |
|---|---|---|---|
| Express | @noverax/courier-express | app.all("/api/request", courierHandler()) | Express |
| Hono | @noverax/courier-hono | app.all("/api/request", courierHandler()) | Hono |
| Fastify | @noverax/courier-fastify | app.register(courierPlugin, { prefix: "/api/request" }) | Fastify |
| NestJS | @noverax/courier-nestjs | consumer.apply(courierMiddleware()).forRoutes("api/request") | NestJS |
The user's session in server code
An API that keeps a session gets the user's session with every call server code makes for a request, once the framework serves the request with it at hand. Each adapter does that in one line; the versions listed are the ones checked in a real application on every change.
| Framework | Serve each request with the session | Checked |
|---|---|---|
| Next.js | createServerCaller(api) | 14, 15, 16 |
| Nuxt | export default defineNitroPlugin(requestContextPlugin) | 3, 4 |
| SvelteKit | registerRequestContext(svelteKitRequestContext(getRequestEvent)), or requestContextHandle() | 2.19, 2 |
| Astro | export const onRequest = requestContext() | 5 |
| React Router | export const middleware = [requestContext()] | 7, 8 |
| Remix | app.use(requestContext()) from @noverax/courier-express, before Remix's handler | 2 |
| SolidStart | registerRequestContext(solidStartRequestContext(getRequestEvent)) | 1, 2 |
| TanStack Start | createServerCaller(api), or createMiddleware().server(requestContext()) in src/start.ts | 1, for React and Solid |
| Express | app.use(requestContext()) | 4, 5 |
| Fastify | app.addHook("onRequest", requestContext()) | 4, 5 |
| Hono | app.use(requestContext()) | 4 |
| NestJS | app.use(requestContext()), on the Express or the Fastify platform | 10, 11, 12 |
Where each goes is in User Sessions, and what Next.js does differently in its guide.
The client side
The adapters serve the proxy. The typed caller the browser calls it with has guides of its own: React, with React Query, and Vue. A mobile app calls its API directly: see React Native & Expo.
Another framework
A framework that hands its route a Web-standard Request and takes a Response back can mount Courier's own handler without an adapter: see Server Handler.