Getting started
How an Orbit account is organised, what lives where in the console, and the shortest path from signing in to serving a name from our network.
This page covers creating a conversation, who may join, the SDK, and what happens when a connection drops.
curl -X POST https://dash.yunzheng.space/api/v1/talk/rooms \
-H "Authorization: Bearer $ORBIT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Support","kind":"room"}'| Field | What it sets |
|---|---|
kind | room keeps history for retention_days; live keeps the last few hundred messages in memory and nothing on disk. |
city | Where it lives. A pack feature; omit it and the city with the most room takes it. Its history lives there too, so it does not move. |
max_peers, max_kbps, retention_days | Ceilings for this conversation, up to what the packs allow. Asking for more is refused rather than quietly reduced. |
public_join | false means the link answers nothing and only tokens from your backend get in. |
The reply carries key (the link) and join_url (the hosted page). Set a passcode with PUT /talk/rooms/{id}/passcode; what is stored is a hash, and there is nothing to read back.
<script src="https://talk.yunzheng.space/v1.js"></script>
<script>
var chat = OrbitTalk.join({
room: "<room key>",
label: "Ada",
passcode: "",
onMessage: function (m) { console.log(m.seq, m.label, m.body); },
onState: function (s, d) { if (s === "open") console.log("in, " + d.members + " here"); },
onPresence: function (p) { console.log(p.members + " here"); },
onError: function (e) { console.error(e.code, e.message); }
});
chat.send("Hello");
// later: chat.leave();
</script>send returns an id at once and the message goes out when the connection allows; if the connection is down it waits in an outbox and goes on the next one. Your application never has to write that buffer.
For a backend that decides who may enter — your users, under your names — turn public_join off, mint the token on your server with POST /talk/rooms/{id}/join (its peer_id is your user's id, its label is their name), and hand it to the SDK through fetchJoin. The SDK calls it again on every reconnect, because a token is good for two minutes.
OrbitTalk.join({
fetchJoin: function () {
// your server calls POST /talk/rooms/{id}/join with the caller's own id and name
return fetch("/my-api/chat-token", { method: "POST", credentials: "same-origin" })
.then(function (r) { return r.json(); });
},
onMessage: function (m) { /* m.peer is YOUR user id; m.label is the name you gave */ }
});Every message carries a sequence number the conversation assigned, and the SDK remembers the last one it saw. On reconnect it asks for everything after that, so nothing is repeated and nothing is missed. Every message you send carries your own id, so a resend after a reset is answered with the number the first copy already has rather than stored twice.
| Limit | Meaning |
|---|---|
| Conversations | how many you may have |
| Connections at once | people connected across all conversations |
| Messages per month | counted once each, however many times a client resends |
| GB per month | bytes in and out |
| Days of history | the ceiling for a conversation; a live chat keeps none |
How an Orbit account is organised, what lives where in the console, and the shortest path from signing in to serving a name from our network.
Add a zone, point your registrar at our name servers, manage records: weighted answers, health-checked records, ALIAS at the apex, zone-file import.
Delegate the whole domain, delegate one hostname, or add a CNAME and leave your DNS where it is. What each one costs you and when to pick it.