Multiple apps and libraries
Mount a second Inertia UI under its own path, with its own shared props, asset version, state cookie, root view, error pages and SSR.
On this page
One ASP.NET Core app can serve more than one Inertia UI. A typical case is a library, such as an admin dashboard, that ships
its own prebuilt client and is mounted under /dashboard in a host app that already uses Inertia.Net.
Each UI is a mount: a named InertiaOptions that app.UseInertia(name) selects inside an app.Map(...) branch. The
default mount is the one AddInertia(...) and UseInertia() configure, so existing apps do not change.
What a mount keeps to itself
Register and map a mount
Map sets the request's path base, so page URLs, Back() fallbacks, Vite asset URLs and the previous-URL cookie stay inside
/dashboard. Calling AddInertia("dashboard", ...) again adds to that mount's configuration.
Startup fails when UseInertia(name) names a mount that was never registered, or when two mounts share a state or
previous-URL cookie name.
A root view shipped by a library
A library cannot rely on a file in the host's content root. Register a keyed IInertiaRootView that writes an embedded
template instead:
Error pages per mount
A mount renders only the error components registered for it, because another mount's components are not in its bundle. A
mount without AddInertiaErrorPages(name, ...) leaves its errors to the rest of the pipeline.
SSR, health checks and TypeScript
Each mount has its own SSR gateway, and its own managed Node processes when o.Ssr.UseNodeProcess() is set; give each mount
its own BasePort. Check a mount's SSR servers with:
o.TypeScript.OutputPath is per mount too, so each client gets its own generated declarations.
For library authors
Expose one registration call and one mapping call, and keep the mount name private to the library:
Mounts are adapter configuration: the Inertia protocol on the wire does not change.