Client setup
Configure Vite and the React, Vue or Svelte client for an Inertia.Net app.
On this page
Inertia.Net speaks the Inertia.js v3 protocol. Install a v3 client package; v2 clients are not supported.
Install the client
Run client setup commands from the ASP.NET Core project directory (the one containing your .csproj). npm, Bun, pnpm and
Yarn are supported. The framework snippets use npm spelling; replace the command with the equivalent for your package manager:
Replace <packages> with the names and version ranges from your framework's snippet. If the project has no package.json,
create one first with npm init -y, bun init -y, pnpm init or yarn init.
@types/node types the node:fs import and process in the Vite config. Add vite/client to tsconfig.json so import.meta.glob is typed:
Use "jsx": "preserve" or omit it for Vue and Svelte.
The starter templates use ClientApp/pages. The manual examples below use resources/js/Pages. Keep the resolver, file paths and Vite entry consistent with the layout you choose.
The templates also ship ClientApp/lib/inertia-signalr.ts, the client transport for live props over SignalR. Uncomment live: signalr() in ClientApp/app.tsx (or app.ts) to turn it on.
Vite configuration
The same Vite config works for every client; only the framework plugin changes.
Add these fields to package.json:
The manifest key of the entry (resources/js/app.tsx) is what you pass to @vite("...").
Client entry
The optional @inertiajs/vite plugin resolves pages and mounts the app for you. With it, the entry is just:
Without the plugin, provide the resolver and setup yourself.
Pages
A page file receives the props from Render(...) as normal component props.
Use the generated types
Inertia.Net can write TypeScript declarations for your page props, shared props and flash data. See TypeScript types.
Development workflow
Open the ASP.NET Core URL, not the Vite URL. Two servers run side by side:
Vite prints localhost:5173 prominently when it starts, but that address is for the browser's asset requests, not for you. In Development the app reads wwwroot/hot and renders the Vite tags; in production it reads the manifest.
For production:
Node is needed to build the assets and only needed at runtime when SSR is enabled.
Using @inertiajs/vite
The plugin also contributes the SSR dev endpoint and page resolution. Add it before the hot-file plugin:
Keep the SSR listener on loopback: the renderer trusts its output and has no authentication. The SSR guide covers the full setup.