Troubleshooting
Find your symptom, then read its causes from the top. Each entry gives the exact text the browser or the API shows, so you can search this page for what is on your screen.
| Symptom | Go to |
|---|---|
| Nothing renders | Nothing renders |
The console reports a CORS error for …/sdk/sessions | CORS error on the session exchange |
The console shows session exchange failed (403) | Session exchange failed (403) |
| The chat panel is at the top-left of the browser window | The panel floats at the top-left |
| Chat answers, but no pins appear on the map | No pins appear |
| The map is 500 pixels tall, or has no height | The map is 500px tall or has zero height |
| A published map says it is not allowed on this site | A published map is not allowed on this site |
| A request returns HTTP 429 | 429 responses |
A request returns HTTP 413, or 422 with a code such as conversation_too_long | 413 and 422: the request is too large |
| Chat stops answering | Chat answers stop |
| A handle method or an attribute change does nothing | A call or an attribute change does nothing |
How Kaleidr reports a failure
The SDK does not throw into your code for a failed mount, and has no error callback or ready event. The one call that throws is Kaleidr.mount with no options object, such as Kaleidr.mount('#map'): it raises a TypeError. A failure shows up in up to three places.
1. The console. Every SDK message contains [kaleidr. A failed mount logs one error in the form [kaleidr:<product>] <reason>, for example:
Error: [kaleidr:chat] kaleidr session exchange failed (403)
2. The Network tab. A keyed mount makes one request to https://api.kaleidr.com/inference-api/b2b/v1/sdk/sessions. Its status and its JSON body tell you why the server refused. The SDK shows only the status, as in the line above. The reason is in the response body. A 403 or 404 carries its code in a field named detail, as below. A 429 carries its code in a field named error, with a sentence in detail; the exception is map_load_quota_exceeded, which arrives in detail:
{ "detail": "insufficient_scope" }
3. Inside the frame, for Viewer. A published map that cannot load shows its reason as text where the map would be.
Reproduce the session exchange outside the browser
When the browser hides a response behind a CORS error, make the same request with curl. Replace the origin with your page's origin, exactly as the browser sends it, and use your own key:
curl -i -X POST https://api.kaleidr.com/inference-api/b2b/v1/sdk/sessions \
-H "Origin: https://www.example.com" \
-H "Content-Type: application/json" \
-H "X-Api-Key: kld_pk_live_…" \
-d '{"product":"chat"}'
Use the product you are mounting: chat, tile or editor. A tile exchange that succeeds counts as one map load.
| Response | Meaning |
|---|---|
200 with a session_token | The key, the origin and the product are all accepted. The problem is in the page, not the key. |
401 {"detail":"Invalid or missing API key"} | The key value is wrong, or the key is revoked or expired. |
403 {"detail":"origin_not_allowed"} | The origin is not in the key's allowed origins. |
403 {"detail":"publishable_key_required"} | The key is not a publishable key. |
403 {"detail":"product_not_allowed"} | The key is restricted to other products. |
403 {"detail":"tier_capability_not_allowed"} | The key carries what the product needs, but your current plan does not admit it. |
403 {"detail":"insufficient_scope"} | The key was created without the scope this product needs. |
429 | See 429 responses. |