Server quickstart
One Swift program, on macOS or Linux: mint a session token with your secret key, list your itineraries, then route a hike from Chamonix to Argentière.
You need Swift 6.2.3 or newer, and two keys from Organization → API keys in the Mountaya app: a secret key, and a publishable key with the publishing and data scopes.
In Package.swift, add the package and link two products:
Your secret key mints a short-lived session token for the publishable key. Put this in Sources/trail-server/main.swift and run swift run:
Every other call sends the publishable key with that token. Replace main.swift with this:
An app never holds the secret key. It posts to your server's /session route, and your server answers the session it minted for the user your own sign-in names. Swift has no web server of its own, so your framework's route on 127.0.0.1:8787 calls this function:
The app decodes that body as a RestSchema.Session and hands it to a SessionTokenEngine.