Skip to content

Protocol support

The adapter implements the Inertia.js protocol used by Inertia.js 3.

Request headers

HeaderHandling
X-InertiaReturns the page as JSON instead of HTML
X-Inertia-VersionCompared with the current version on GET; a mismatch returns 409
X-Inertia-Partial-ComponentEnables partial reload filtering when it matches the rendered component
X-Inertia-Partial-DataProps to include, with dot notation
X-Inertia-Partial-ExceptProps to exclude, with dot notation
X-Inertia-ResetMerge props to replace instead of merge
X-Inertia-Error-BagNests the default validation errors under the bag name
X-Inertia-Except-Once-PropsOnce props the client already has
X-Inertia-Infinite-Scroll-Merge-Intentprepend makes scroll props prepend
Purpose: prefetchKeeps fragment redirects as regular redirects

Response headers and status codes

SituationResponse
Inertia visit200, Content-Type: application/json, X-Inertia: true
First visit200, Content-Type: text/html; charset=UTF-8
Every response through the middlewareVary: X-Inertia
Outdated asset version on GET409, X-Inertia-Location, X-Inertia-Version
location() for an Inertia visit409, X-Inertia-Location
302 after PUT, PATCH or DELETEChanged to 303
Redirect to a URL with a fragment409, X-Inertia-Redirect
Empty 200 response to an Inertia visitRedirect back

Page object

KeyWhen present
component, props, url, versionAlways
sharedPropsWhen there are shared props (always, because of errors)
deferredPropsDeferred props were left out
mergeProps, prependProps, deepMergeProps, matchPropsOnMerge props were included or announced
scrollPropsScroll props were included
oncePropsOnce props were included or skipped
rescuedPropsDeferred props with rescue failed
flashFlash data was stored
encryptHistoryHistory encryption is enabled
clearHistoryHistory clearing was requested
preserveFragmentFragment preservation was requested

Not supported

  • Precognition (live validation requests)
  • Automatic existence checks for page component files

Released under the MIT License.