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-extensionnpm install @dudousxd/nestjs-inertia @dudousxd/nestjs-inertia-vite
npm install --save-dev @dudousxd/nestjs-codegen @dudousxd/nestjs-inertia-codegen-extensionyarn add @dudousxd/nestjs-inertia @dudousxd/nestjs-inertia-vite
yarn add -D @dudousxd/nestjs-codegen @dudousxd/nestjs-inertia-codegen-extensionHTTP adapter
NestJS defaults to Express. If you use Fastify, install the Fastify adapter instead.
Express (default)
pnpm add express
pnpm add -D @types/expressnpm install express
npm install --save-dev @types/expressyarn add express
yarn add -D @types/expressFastify
pnpm add fastify @fastify/cookie @nestjs/platform-fastifynpm install fastify @fastify/cookie @nestjs/platform-fastifyyarn add fastify @fastify/cookie @nestjs/platform-fastifyPeer dependencies
| Peer dep | Required by | Condition |
|---|---|---|
@nestjs/common >=10 | core | always |
@nestjs/core >=10 | core | always |
express >=4 | core | Express adapter (default) |
fastify >=4 | core | Fastify adapter |
vite >=5 | vite | build pipeline |
@nestjs/testing >=10 | testing | test suites |
typescript >=5 | @dudousxd/nestjs-codegen | CLI static analysis |
@dudousxd/nestjs-codegen >=0.1 | codegen extension | typed-client codegen host |
@inertiajs/react >=1 | codegen extension | provides 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-testingnpm install @dudousxd/nestjs-inertia-client
npm install --save-dev @dudousxd/nestjs-inertia-testingyarn add @dudousxd/nestjs-inertia-client
yarn add -D @dudousxd/nestjs-inertia-testingEngine requirements
All packages require Node.js >= 20. NestJS 10 and 11 are both supported.