TypeScript

Nitro is TypeScript-first: write your config, handlers, and server code in TypeScript with zero setup.

Nitro is written in TypeScript and bundles your server code, so .ts files work out of the box in development and production, with no separate compile step. The TypeScript compiler is only needed for type checking (for example tsc --noEmit in CI).

All public utilities ship with types:

import { defineConfig } from "nitro";

export default defineConfig({
  // Fully typed config with completions
});

Types (such as NitroConfig, NitroModule, or NitroRuntimeConfig) are exported from nitro/types:

import type { NitroModule } from "nitro/types";

#tsconfig.json setup

Nitro provides a shareable TypeScript configuration you can extend from:

tsconfig.json
{
  "extends": "nitro/tsconfig"
}

It enables modern, strict defaults matching how Nitro bundles your code: strict type checking, bundler module resolution, noEmit, verbatimModuleSyntax, and allowImportingTsExtensions (so you can use explicit .ts extensions in imports). You can override any option by adding your own compilerOptions on top:

tsconfig.json
{
  "extends": "nitro/tsconfig",
  "compilerOptions": {
    "jsx": "react-jsx"
  }
}

#typescript config options

OptionDefaultDescription
tsConfigProject tsconfig.jsonTypeScript config used by the bundler for JSX options and path aliases.

Nitro reads your project's root tsconfig.json to pick up JSX settings (jsx, jsxFactory, jsxFragmentFactory, jsxImportSource) and path aliases. Set typescript.tsConfig to override it:

nitro.config.ts
import { defineConfig } from "nitro";

export default defineConfig({
  typescript: {
    tsConfig: {
      compilerOptions: {
        jsx: "react-jsx",
      },
    },
  },
});

Nitro  builds full-stack servers that deploy anywhere.