Server quickstart
A Kotlin program on the JVM that mints a session token, calls the Data API with it, and hands tokens to your app.
You need JDK 17 or newer and Gradle. You also need two keys from Organization → API keys in the Mountaya app: a secret key, and a publishable key with the publishing and data scopes. Export both:
Create a Kotlin JVM application and add the admin package, which brings the client with it:
Each program below is a whole src/main/kotlin/Main.kt. Run it with ./gradlew run.
A client built over the secret key mints the token through the admin package:
Every other call sends the publishable key with the minted token:
An app never holds the secret key. Your server answers POST /session with a token minted for the member your own sign-in vouches for:
The app's SessionTokenEngine posts to that address and reads the Session it answers. Authentication in the SDK wires it.