Production checklist
An integration that works on localhost can still fail in production, or cost more than you planned. Work through this list before you ship. Each item says what to do, why, and how to check it.
The short list
- One key per site and per environment, each with a name that says where it runs.
- Allowed origins set on every publishable key in production.
- No server key in any page, app binary or public repository.
- Content Security Policy allows what each product loads, tested on the real site.
- Consent handled, if your site asks visitors for it.
- Layout checked: element heights set, the chat panel docked where you want it.
- Quota understood: you know what your visitors see when a pool runs out.
- Errors handled in any code that reads a stream.
- Teardown called on route changes in a single-page app.
- Test keys not mistaken for a sandbox.
- Usage monitored, with someone responsible for it.
Separate keys per site and environment
Create a different key for each place your integration runs: one for production, one for staging, one for each customer-facing site. Name each key after where it runs.
Why:
- You can revoke one without stopping the others. Revoking a key ends it and every session issued from it immediately.
- Each key gets its own allowed origins. A production key that also lists
http://localhost:3000can be used by anyone running a page on their own machine. - Each key has its own request-rate budget. Every visitor using one publishable key shares that key's requests-per-minute budget. Splitting busy sites across keys keeps one from starving another. How the budgets work, and what a refused request looks like, is in Quota and rate limits.
The number of active keys is limited per plan; the limits are listed under What each plan admits. All keys of an organization still share one pool of AI credits and one pool of map loads. To fence one key's spending, set a monthly AI credit limit on it through the key API.
Check: kaleidr.com/api-keys shows one clearly named key for each site, and no key you cannot account for.
Allowed origins on every publishable key
A publishable key with no allowed origins works from any site. That is fine on day one and wrong in production: the key is in your page source, and anyone can copy it and run Chat on their own site with your AI credits.
For each production key, list exactly the origins that serve your pages:
- Include every variant you serve:
https://example.comandhttps://www.example.comare different origins. - Include the port if it is not the default.
- Do not include
localhoston a production key. Use a separate key for development.
Check: open your production page. The product renders and the Network tab shows a 200 from …/b2b/v1/sdk/sessions. Then confirm the lock works: serve the same page from an origin that is not listed and see that nothing renders and the console reports a CORS error for that request.
The allowed-origins list stops other websites from using your key in a browser. It is not a secret-keeping mechanism: a program that is not a browser can send any Origin header. Kaleidr rate-limits each key and you can cap its monthly spend, which bounds what a copied key can cost. See Security model.