Session tokens
When your organization turns on Require session token, the embed needs a short-lived token beside its publishable key. Your server mints it, a script on your page hands it to the embed, and the embed asks for a new one before it expires.
1
Serve GET /api/mountaya-embed-session from your backend. It calls POST /v1/sessions with your secret key and the embed's publishable key, and returns the session.
Send no user_id. The token then reads only what you publish, like the key alone.
2
Paste this script once per page, beside the iframe. It answers every embed on the page from your endpoint.
When your organization requires session tokens, the embed snippet you copy from Map Studio already carries this script. Change endpoint if yours lives elsewhere.
3
The iframe from the quickstart needs no change. The embed asks your page for its first token as it loads.
The embed sends the new token with its next request, without reloading.
You may also append &session_token=sess_your_session_token to the iframe src. The embed uses it only until the script first answers, so keep the script.
- The map stays blank, then gives up. The embed waited 10 seconds for a token. Check that the script is on the page and that your endpoint answers
200. - The console says the token names a user. Mint without
user_id. - The map loads, then stops after a few minutes. Your endpoint failed on a renewal. The console names the status it answered.