Skip to content
Inertia

Kotlin & Java API

Every public entry point is @JvmStatic or an open Java class so Java apps call the same API.

  • setManager / manager / reset
  • render (1–3 argument overloads)
  • share (key/value and map)
  • version
  • location

Extend HandleInertiaRequests and override share / version. Return types use maps that Java can construct with Map.of.

Sample Path
Kotlin samples/inertia-kotlin
Java samples/inertia-java
Terminal window
./gradlew :inertia-sample-kotlin:test :inertia-sample-java:test
./gradlew :inertia-sample-kotlin:run --args="--base=$(pwd)/samples/inertia-kotlin"