Workspaces and segments
A workspace holds your package, team and billing; a segment is one isolated app inside it.
Workspace
A workspace is your team's account. It has:
- one package, which sets the allowances for connections, messages, data transfer, topics and segments. Usage is pooled across all the workspace's segments;
- team members, each with a role (owner, admin, editor or viewer);
- billing, and Platform API keys for your servers.
Each person can own one Free workspace, and can be a member of any number of workspaces.
Segment
A segment is one app in one environment, for example "Chat (production)" or "Chat (staging)". It has its own:
- signing keys and publishable keys, so a token for one segment never works in another;
- topic rules, and the topics they allow;
- settings: which transports it accepts, whether anonymous visitors may connect, how many connections one user may hold, its own limits and its rate-limit preset.
Every token carries its segment's ID, and the Realtime API takes the segment only from the verified token. No request names a segment any other way, so one segment's clients can never reach another's topics.
| Use a separate segment for | Why |
|---|---|
| Each environment | A staging token can't reach production data, and you can test new rules safely |
| Each independent app | Separate keys, rules and limits; usage shows per segment |
Topics in one segment are separate from same-named topics in another: chat/lobby in staging and chat/lobby in
production never meet.
When a segment stops serving
A segment refuses connections with Suspended when you turn it off in its settings, or when the workspace's
package is no longer active (for example, a cancelled subscription has ended). Open connections are closed with the
same code.