Install
Nestia runs on TypeScript 7 through ttsc.
Install the compiler toolchain, the runtime packages, and the CLI explicitly:
npm
npm i -D ttsc typescript
npm i typia @nestia/core @nestia/sdk @nestia/fetcher
npm i -D nestia@nestia/sdk is a runtime dependency. The generated SDK and runtime Swagger
composition both resolve it while the Nestia transform attaches route metadata.
tsconfig.json
Keep the NestJS decorator metadata flags. Do not add compilerOptions.plugins
for normal Nestia setup; ttsc discovers @nestia/core, @nestia/sdk, and
typia from their package manifests.
{
"compilerOptions": {
"strict": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true
}
}Transform options
No plugin config means Nestia uses its defaults:
@TypedBodyvalidates with"validate".@TypedRouteserializes with"assert".- LLM schema restrictions are off.
Add compilerOptions.plugins only when you want to override those options:
{
"compilerOptions": {
"plugins": [
{ "transform": "typia/lib/transform", "enabled": false },
{
"transform": "@nestia/core/native/transform.cjs",
"validate": "validatePrune",
"stringify": "validate.log",
"llm": { "strict": true }
}
]
}
}If a nest new project has tsconfig.build.json, point ttsc at that file so
test files stay out of production output:
{
"scripts": {
"build": "ttsc -p tsconfig.build.json"
}
}Build
Replace NestJS CLI build commands with ttsc / ttsx.
{
"scripts": {
"build": "ttsc",
"start": "node dist/main.js",
"start:dev": "concurrently \"ttsc --watch\" \"node --watch dist/main.js\"",
"start:script": "ttsx src/main.ts"
}
}nest build, nest start, tsc, ts-node, and tsx do not run the Nestia
transform. Use ttsc for builds and ttsx for direct TypeScript execution.
Generate
Create nestia.config.ts once, then run the generators:
npx nestia init
npx nestia sdk
npx nestia swagger
npx nestia e2e
npx nestia allinit writes a starter config. sdk, swagger, and e2e emit one artifact
each; all runs the three together.
Bundlers
A normal NestJS server should compile with ttsc directly. When a bundler owns
the build, install @ttsc/unplugin and add the adapter for that bundler.
npm
npm i -D @ttsc/unpluginimport ttsc from "@ttsc/unplugin/vite";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [ttsc()],
});Use the matching import path for other bundlers:
@ttsc/unplugin/webpack, @ttsc/unplugin/rspack,
@ttsc/unplugin/esbuild, @ttsc/unplugin/next,
@ttsc/unplugin/rollup, @ttsc/unplugin/rolldown,
@ttsc/unplugin/farm, or @ttsc/unplugin/bun.
Troubleshooting
no transform has been configured: the project was built bytsc,nest build, SWC, Babel, or another path that skippedttsc.- Empty SDK or Swagger output: confirm the controllers use
@TypedRouteand that the generator reads the sametsconfig.jsonas the build. - NestJS DI fails: restore
experimentalDecoratorsandemitDecoratorMetadata; NestJS still needs them for constructor injection. - Bundler output skips validation: add the matching
@ttsc/unpluginadapter to the bundler config.