Installation
bash
npm add inertia-nativeRequirements
@inertiajs/core>= 3.0react>= 18 — only for theinertia-native/reactentryvue>= 3.0 — only for theinertia-native/vueentrysvelte>= 4.0 — only for theinertia-native/svelteentry
Setup
Call initInertiaNative() once, before createInertiaApp, in your Inertia entrypoint:
js
import { createInertiaApp } from '@inertiajs/react'
import { initInertiaNative } from 'inertia-native'
const isNativeApp = !!window.webkit?.messageHandlers?.turbo
initInertiaNative({ debug: import.meta.env.DEV || isNativeApp })
createInertiaApp({ /* ... */ })That's all that's needed for native navigation (push/pop/replace/restore, modals, forms, error screens, pull-to-refresh). See the API for the available options.
To set up the native iOS and Android shells that load your app, see Native apps → iOS and Android.
Upgrading from 0.1.0-beta
initHotwireNativeis nowinitInertiaNative.@inertiajs/core2.x is no longer supported.- The package was published as
inertia-hotwire-nativebefore0.1.0-beta.2; replace that dependency withinertia-native.
Next: Navigation.