Inertia.js

Build server-driven single-page applications with Litestar routes, Inertia responses, and the same asset/runtime system used for the rest of the project.

See also

Official Inertia.js docs: Getting Started

Note

This section targets the current stable Inertia v2 docs and client APIs. If Litestar-Vite adopts Inertia v3 behavior later, version-specific setup details such as script-element bootstrap should be documented as a separate, explicit upgrade path.

Installation

Turn on the Inertia plugin, add session middleware, and wire the frontend entrypoint correctly.

Installation
How It Works

Understand the request headers, initial page payload, partial reload protocol, and response lifecycle.

How It Works
Configuration

Control script-element bootstrap, SSR, page props, redirects, history encryption, and Precognition.

Configuration
SSR Reference

See how the Node SSR renderer fits into the existing Litestar integration without turning into framework proxy mode.

Inertia SSR (JS)

Starter Paths

Pages and Responses

Start with page components, response helpers, redirects, links, and form handling.

Pages
Data and Props

Move from shared data to partial reloads, deferred props, once props, merging, polling, prefetching, and infinite scroll.

Shared Data
Security and Validation

Cover CSRF, history encryption, Precognition, validation, and error handling.

CSRF Protection
TypeScript Integration

Generate page prop metadata, share types with the frontend, and keep SSR/bootstrap behavior aligned.

TypeScript Integration

Getting Started

Core Concepts