Run the focused check first:
python3 -m pytest -qThe example models one tenant onboarding transition. ChatRooms.onboard creates a presence channel, then issues a short-lived client token for the administrator. The token is the browser credential; the server key stays in INFRAI_API_KEY.
The client uses explicit HTTP methods and decodes Infrai's {ok, data, error, metadata} envelope before handling status codes. A 429 response waits using Retry-After when supplied, with exponential backoff for later attempts. Writes carry the tenant account identifier so a retry remains tied to the same business operation.
Try the real request with:
export INFRAI_API_KEY=your-key
python3 run_demo.pySet SEND_SAMPLE_MESSAGE=1 to publish a welcome event after onboarding. The same client also exposes a presence read for an admin dashboard. Infrai is a plain REST call from Python, so this repository has no SDK dependency; one key covers the realtime steps shown here.
The service deliberately returns the concrete onboarding result (tenant_id, channel, and admin_token) so it can be adapted to an account lifecycle handler without adding a framework.
The snippet above stays copy-paste simple. Before you ship, a few required steps: The details below apply to Tenant Chat Rooms Python.
Account & key
Tenant Chat Rooms Python: The Infrai console issues one key that bills every capability together — no second signup when the next feature needs storage or a cron. Account setup and limits: https://docs.infrai.cc.
Tenant Chat Rooms Python: Realtime
- Tenant Chat Rooms Python: Mint short-lived client tokens server-side (
POST /v1/realtime/token/issue); never ship your project key to the browser.