
# Advanced

> Low-level options. Most projects should not need to change these.

::note
All examples on this page assume the following import in `nitro.config.ts`:

```ts
import { defineConfig } from "nitro";
```
::

### `dev`

- Default: `true`{lang=ts} for development and `false`{lang=ts} for production

::warning
This is an advanced configuration. Things can go wrong if misconfigured.
::

```ts
export default defineConfig({
  dev: true, // force development mode behavior
});
```

### `typescript`

- Default: `{}`{lang=ts}

TypeScript options. `tsConfig` is the config used by the bundler for JSX options and path aliases and defaults to the project's `tsconfig.json`. `tsconfigPaths` (default: `true`) resolves its path aliases (`compilerOptions.paths`) for the server sources.

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

### `hooks`

::warning
This is an advanced configuration. Things can go wrong if misconfigured.
::

Nitro hooks. See [hookable](https://github.com/unjs/hookable) for more information.

```ts
export default defineConfig({
  hooks: {
    compiled(nitro) {
      console.log("Build compiled successfully!");
    },
  },
});
```

Hooks with the same name do not override each other. Hooks defined by the deployment preset run first, then hooks from your config. Defining a hook with the same name no longer disables the preset's hook.

:read-more{to="/docs/lifecycle"}

### `commands`

::warning
This is an advanced configuration. Things can go wrong if misconfigured.
::

Preview and deploy command hints are usually filled by deployment presets.

`deploy` can be a shell command (`./` paths are resolved relative to the output directory) or a function receiving the Nitro instance, used by presets that deploy programmatically. Both are run by [`nitro deploy`](/docs/cli#nitro-deploy) and the [`deploy`](/docs/utils#nitrobuilder) builder API.

```ts
export default defineConfig({
  commands: {
    preview: "node ./server/index.mjs",
    deploy: "npx wrangler deploy ./server/index.mjs",
  },
});
```

### `devErrorHandler`

::warning
This is an advanced configuration. Things can go wrong if misconfigured.
::

A custom error handler function for development errors.

```ts
export default defineConfig({
  devErrorHandler: (error, event) => {
    return new Response(`Dev error: ${error.message}`, { status: 500 });
  },
});
```

### `tracingChannel`

**🧪 Experimental!**

- Type: `boolean`{lang=ts} | `{ srvx?: boolean, h3?: boolean, unstorage?: boolean, db0?: boolean }`{lang=ts}
- Default: `false`{lang=ts}

The `tracingChannel` option enables [`TracingChannel`](https://nodejs.org/api/diagnostics_channel.html#class-tracingchannel) instrumentation for request handling. It is wired for Node.js and also works in Bun, Deno, and the development preset, any runtime that exposes `node:diagnostics_channel`. The published `srvx.request` and `h3.request` channels remain available across these runtimes and can be consumed by APM tools and custom subscribers.

Pass `true` to enable every channel, or an object to toggle them individually.

```ts
export default defineConfig({
  tracingChannel: true,
});
```

### `framework`

- Default: `{ name: "nitro", version: "<current>" }`{lang=ts}

Framework information. Used by presets and build info. Typically set by higher-level frameworks (e.g. Nuxt).

```ts
export default defineConfig({
  framework: { name: "my-framework", version: "2.0.0" },
});
```

### `manifest`

Build manifest options. Use `deploymentId` to include a custom deployment identifier in the build manifest (some presets fill it automatically from platform environment variables).

```ts
export default defineConfig({
  manifest: { deploymentId: process.env.DEPLOY_ID },
});
```
