Skip to content

Introduction

Inertia (trk/processwire-inertia) is the server-driven Inertia.js v3 protocol adapter for ProcessWire 3. It lets you render React, Vue, or Svelte page components directly from ProcessWire templates and Custom Page Classes while keeping native ProcessWire routing, authentication, CSRF protection, selectors, and $session workflows intact.

You can enable Inertia on selected templates alongside classic server-rendered ProcessWire templates (Hybrid Mode), or switch your entire frontend to a single-page application (Full SPA Mode) with a single setting.

flowchart LR
    REQ["Browser Request"] --> PW["ProcessWire Router & Template"]
    PW --> CLS["Custom Page Class (InteractWithInertia)"]
    CLS --> PROV["3-Tier DataProvider Pipeline"]
    PROV --> CHECK{"X-Inertia Header?"}
    CHECK -- "No (Initial Load)" --> ROOT["Root View (_inertia.php) + Optional SSR"]
    CHECK -- "Yes (SPA Navigation)" --> JSON["JSON Page Object (component, props, url, version)"]

Hybrid & Full SPA Routing

Adopt Inertia gradually on specific templates without breaking existing Markup Regions or _main.php layouts, or enable Full SPA mode across every frontend template.

Custom Page Classes & v3 Props

Keep template files to a single line with InteractWithInertia and ship defer(), scroll(), merge(), once(), optional(), and always() props natively.

3-Tier DataProviders & TypeScript

Serialize ProcessWire fields, focal-point images, repeaters, and relations cleanly, and generate strongly typed inertia.d.ts interfaces and *Page.php classes.

Fault-Tolerant SSR & Forms

Dispatch initial renders to a local Node or Bun SSR server with automatic client-side fallback, JSON-to-POST syncing, CSRF cookies, and live Precognition validation.

Next steps