Aviary
Guides

Installation

Install nestjs-inertia packages with pnpm, npm, or yarn, and understand peer dependencies.

Install core + Vite

pnpm add @dudousxd/nestjs-inertia @dudousxd/nestjs-inertia-vite
pnpm add -D @dudousxd/nestjs-codegen @dudousxd/nestjs-inertia-codegen-extension
npm install @dudousxd/nestjs-inertia @dudousxd/nestjs-inertia-vite
npm install --save-dev @dudousxd/nestjs-codegen @dudousxd/nestjs-inertia-codegen-extension
yarn add @dudousxd/nestjs-inertia @dudousxd/nestjs-inertia-vite
yarn add -D @dudousxd/nestjs-codegen @dudousxd/nestjs-inertia-codegen-extension

HTTP adapter

NestJS defaults to Express. If you use Fastify, install the Fastify adapter instead.

Express (default)

pnpm add express
pnpm add -D @types/express
npm install express
npm install --save-dev @types/express
yarn add express
yarn add -D @types/express

Fastify

pnpm add fastify @fastify/cookie @nestjs/platform-fastify
npm install fastify @fastify/cookie @nestjs/platform-fastify
yarn add fastify @fastify/cookie @nestjs/platform-fastify

Peer dependencies

Peer depRequired byCondition
@nestjs/common >=10corealways
@nestjs/core >=10corealways
express >=4coreExpress adapter (default)
fastify >=4coreFastify adapter
vite >=5vitebuild pipeline
@nestjs/testing >=10testingtest suites
typescript >=5@dudousxd/nestjs-codegenCLI static analysis
@dudousxd/nestjs-codegen >=0.1codegen extensiontyped-client codegen host
@inertiajs/react >=1codegen extensionprovides the router for navigate()

Optional packages

Install only what you need.

# Typed HTTP client + <Link> components
pnpm add @dudousxd/nestjs-inertia-client

# Test helpers (expectInertia, InertiaTestingModule)
pnpm add -D @dudousxd/nestjs-inertia-testing
npm install @dudousxd/nestjs-inertia-client
npm install --save-dev @dudousxd/nestjs-inertia-testing
yarn add @dudousxd/nestjs-inertia-client
yarn add -D @dudousxd/nestjs-inertia-testing

Engine requirements

All packages require Node.js >= 20 (>= 20.19 when running NestJS 12). NestJS 10, 11 and 12 are all supported.

@dudousxd/nestjs-inertia >= 1.4.4 for streaming responses

InertiaMiddleware runs on every request matched by its route registration — not just Inertia renders — and patches the response object to suppress writes after headers are sent. Versions before 1.4.4 gated res.end() on res.headersSent, which swallowed the final end() call on streaming responses (SSE, NDJSON, file downloads) that flush headers before streaming the body. The connection would then hang until the client/proxy idle timeout (ERR_HTTP2_PROTOCOL_ERROR behind an ALB). If your app serves any streaming HTTP responses alongside Inertia pages, pin @dudousxd/nestjs-inertia to >= 1.4.4.

On this page