Reference
The SDK's calls, the CLI's commands, the management API, token claims, close codes and every value; Overview says how each behaves.
SDK
The package tablebox.io, in TypeScript, for browsers and for Node on the versions of Get started. It installs by the address of its package (the hosted service); once it is on npm, it also installs with install scripts turned off. A page with no bundler loads its browser file, dist/browser.js, one ES module, from a CDN such as jsDelivr (where WebCodecs has no audio, such a page has no sound: Media without WebCodecs audio).
| Call | TypeScript | |
|---|---|---|
| Connect | connect(token, { room? }): token is a token, or a function that gives one (or a promise of one) before every attempt |
Connecting |
| The connection | id, status, transport, onStatus(status => …), reason, close(), origin |
Connecting |
| State | State.publish(connection, name, value): set(value), close(); State.subscribe(connection, name, (id, value) => …, { from? }): a Map of ID to value, close() |
State |
| Log | Log.publish(connection, name): append(value), close(); Log.subscribe(connection, name, record => …, { from? }): records, close() |
Log |
| Media | Media.publish(connection, name, stream): set(stream), close(); Media.subscribe(connection, name, (id, stream) => …, { from? }): a Map of ID to MediaStream, close(); Media.show(element, stream, { muted? }): shows a stream's picture in a <video> or <audio>, and plays someone else's sound through the page, as the browser's autoplay rules allow; browsers only |
Media |
| Files | Files.publish(connection, file): resolves with ref, close(); Files.fetch(connection, ref): resolves with a Blob |
Files |
| MoQ | moq: the @moq/net the SDK uses; connection.origin is its Origin |
Other kinds of data |
| Backend | sign(key, { user, room }) and remove(key, { user?, room }), from tablebox.io/server |
tablebox.io/server |
Every subscribe takes its callback: without one, it throws TypeError('give a callback').
connect's room must match the token's room, and may be left out when that is a room, not a pattern, as in a token from sign. Before any dial, connect rejects with a TypeError:
| Message | When |
|---|---|
this is not a Tablebox token: tablebox init, tablebox token or sign makes one |
The token is not a JWT whose claims hold a room pattern, relays of https URLs, hashes of strings or none, and a sub that is a user or none (Token claims) |
give a room: this token lets a page into any room matching {pattern} |
No room is given, and the token's room is a pattern |
a room is a path, such as boards/42 |
The room is not a room (Paths and names) |
this token does not let a page into {room}: it lets in {pattern} |
The token's room does not match the room |
Given a function, connect checks its first token so, and rejects as the function does when its first call throws.
The connection:
id |
The connection's ID: the tab's 22 characters (Connecting without the SDK), after the first token's sub and ~ when it has one. Set once connect() resolves |
status |
connecting (also while reconnecting), connected or closed |
transport |
The session's transport, webtransport or websocket (Transports); undefined while not connected |
onStatus(status => …) |
Calls back with each new status; returns a function that stops it |
reason |
Why the last session ended or was refused, when the Relay said; once closed, why it closed: an Error whose name is the code's name (Close codes) |
close() |
Closes the connection, and everything published, read and sent with it |
origin |
The @moq/net Origin everything goes through |
The types:
| Type | What it is |
|---|---|
Connection |
id, status, transport, reason, onStatus, close, origin |
ConnectOptions |
{ room? } |
Status |
connecting, connected or closed |
Transport |
webtransport or websocket |
State.Published<T>, State.Values<T> |
What State.publish and State.subscribe return |
Log.Appending<T>, Log.Records<T>, Log.LogRecord<T> |
What Log.publish and Log.subscribe return; a record, { id, at, value } |
Media.Sending, Media.Streams |
What Media.publish and Media.subscribe return |
Files.FileRef, Files.Shared |
{ hash, name, size, type }: the SHA-256 (hex) of the content, and the name, size and type of the file shared; what Files.publish resolves with, { ref, close() } |
tablebox.io/server
For your backend, in Node or anywhere else WebCrypto has Ed25519. key is the folder's key, TABLEBOX_KEY as tablebox init writes it (.env.local). Either call rejects with TypeError('not a TABLEBOX_KEY: tablebox init writes one, an Ed25519 key with its project, Relays and Manager') for a key that is not one.
| Call | Does |
|---|---|
sign(key, { user, room }) |
Resolves with a token for user in room, publishing there, for 10 minutes, as connect takes it from a function. Calls nothing. Rejects with a TypeError for a user that is not a user (Token claims) or a room that is not a room |
remove(key, { user, room }) |
Removes user in room and the rooms below it (Removals and closings); with no user, closes them. One POST to the key's Manager, /v1/projects/{project}/removals or /closings, with a management token of the key. Resolves with the removal {sub, path, at}, or the closing {path, at}, once Manager took it: tokens issued at or before at stay refused. Rejects with Error('Manager answered {status} {code}: {message}') when it refuses (503 unavailable while Manager is down), Error('Manager answered {status} with no code or message') for an answer that is not Manager's, and the network's error when Manager cannot be reached or gives no answer within 30 s |
Transports
A connection runs over WebTransport, or over WebSocket at the same address, as the official MoQ client chooses: every WebKit browser (Safari, every iOS browser) and Firefox before 153 use WebSocket, and other browsers use it when WebTransport is missing or slower. Node uses WebTransport. The rules are the same on each.
On a Linux machine without IPv6, a Node program on the SDK aborts, and tablebox ls and tablebox read end with a network error: their QUIC clients bind an IPv6 socket, which a kernel without IPv6 refuses. Run them on a machine with IPv6. Browsers are not affected.
Paths and names
A room is 1 to 27 segments separated by /, such as boards/42, none of them empty, starting with ., holding * or being ~. A name is one segment that does not start with . and has no *. In a room, each person's things are broadcasts at {kind}/{name}/{id}, which tablebox ls lists:
| Kind | Path | Tracks |
|---|---|---|
| State | state/{name}/{id} |
value: each value one group of one frame of JSON |
| Log | log/{name}/{id} |
records: a @moq/json window of { at, value } |
| Media | media/{name}/{id} |
A hang broadcast, with catalog.json: H.264 up to 1280x720, Opus |
| Files | files/{hash}/{id} |
data.0 to data.{n-1}, one for each 4 MiB of the content (at least one) |
Connecting without the SDK
A program on the official moq crates connects with the same tokens. It dials a Relay of the token's relays with three query parameters: jwt, the token; secret, 32 to 128 characters from A–Z a–z 0–9 - _; and room, the room, which may be left out when the token's room is a room. The connection's ID is the first 22 characters of the unpadded base64url SHA-256 of secret, after the token's sub and ~ when it has one, so one secret always gives one ID, and the ID keeps the secret hidden. The session sees its room alone: it reads every {kind}/{name}/{id} there, and publishes at its own ID when the token has publish.
The SDK keeps each tab's secret in its sessionStorage, as tablebox.io:secret, and sends one made from it and the token's Relays.
Media without WebCodecs audio
In a browser without WebCodecs' AudioEncoder and AudioDecoder, Media encodes and decodes Opus with libav.js, which it loads from the folder of the script that holds the SDK: dist/browser.js, or your bundle, such as public/page.js. The SDK's package carries its files beside dist/browser.js: libav-6.10.9.0-opus-af.wasm.mjs and libav-6.10.9.0-opus-af.wasm.wasm, and libav-6.10.9.0-opus-af.asm.mjs for browsers without WebAssembly. libav.js runs in a Worker made from the first of them, and a browser makes a Worker only from the page's own origin: a page that loads dist/browser.js from a CDN has no sound in such a browser, and one that loads it from its own site needs nothing more. A bundled page serves the files beside its bundle:
cp node_modules/tablebox.io/dist/libav-6.10.9.0-opus-af.* public/Content Security Policy
Where WebCodecs has audio, the SDK reaches nothing but the Relays, over https:// and wss://. A page with a Content Security Policy lets it reach every Relay with connect-src https://*.{zone} wss://*.{zone}, where {zone} is the domain the Relays are named in (example.com for https://relay-a.example.com/). The hosted service names every Relay in one domain, so a Relay added or removed changes no page's policy, while a policy that lists the Relays one by one would. Where WebCodecs has no audio, the SDK also fetches libav.js's files from the folder of the script that holds it (Media without WebCodecs audio), and the whole of Media's sound fails when it cannot: such a page adds that folder's origin to connect-src ('self' for a page served with its bundle) and, if it sets script-src, adds 'wasm-unsafe-eval' to it.
CLI
tablebox, one executable for macOS, Linux and Windows, installed with its install script (Get started). Results go to standard output, and messages and errors to standard error. Every command but init, status, help and --version acts on the project of .env.local in the current folder, with the folder's key, TABLEBOX_KEY; without it, a command ends with error: run tablebox init here first: .env.local has no TABLEBOX_KEY. A failed command exits with 1 and says why, passing a refusal on as it came: error: Manager answered {status} {code}: {message} for Manager's (Errors), or Manager answered {status} with no code or message for an answer that is not Manager's, and the Relay closed the connection: {name} ({code}) for a Relay's (Close codes). The CLI keeps nothing of its own, writes nothing but .env.local, and never prints a private key.
| Command | Does |
|---|---|
tablebox init |
In a folder whose .env.local has no TABLEBOX_KEY: makes a key here, and has Manager make a temporary project of its public key, named after the folder, with no account; appends TABLEBOX_KEY to .env.local (its form); and prints a token for pages into any room (**), publishing, signed with the key. Its standard error names the project, says that the token lets whoever loads a page into any room the page names, and gives the deletion time: the project is deleted at {time} unless claimed: tablebox claim keeps it. While Tablebox holds as many temporary projects as it takes, Manager answers 503 busy, and init writes nothing. When Manager made the project but .env.local cannot be written, it exits with 1 and names the project and its deletion time. In a folder whose .env.local has TABLEBOX_KEY: says .env.local has TABLEBOX_KEY already: init does nothing here, and does nothing else |
tablebox token --room {pattern} [--publish] |
Prints a token for pages into the rooms {pattern} matches, any pattern of Token claims, such as **, shows/* or one room, reading, and publishing with --publish, signed with the folder's key, with no call. Its standard error names the key: signed with key {id}; tablebox key replaces the key and stops every token it signed |
tablebox claim |
While nobody owns the project: prints an address on Console that claims it, with a code that works for 15 minutes, or until Manager restarts, and replaces the last one; its standard error says to open it, sign in with GitHub and accept by then (Get started). Once someone does: prints nothing, and its standard error names the owners, project {id} is claimed: owners {login} ({user ID}), … |
tablebox key |
Makes a new key here; has Manager add it to the project, with a management token of the old key; writes it into .env.local in place of TABLEBOX_KEY's line, leaving every other byte; and has Manager delete the old key, with a management token of the new one, so that the Relays refuse every token the old key signed and close the connections they admitted. Its standard error names both keys. When the old key is not deleted, the new one is in .env.local already: it exits with 1, and says that tablebox api DELETE /projects/{project}/keys/{old} deletes it. When the new key was added but .env.local cannot be written, the old key stays there: it exits with 1, and names the added key and the call that deletes it |
tablebox api {method} {path} [{json}] |
Calls Manager's management API at /v1{path} with a management token of the folder's key, and prints the answer's JSON; for an answer with no body, its standard error says Manager did {method} {path} |
tablebox ls {room} [--watch] |
Prints the paths published in the room, {kind}/{name}/{id}, those with a segment starting with . included, one per line, once none has come or gone for 1 s (3 s while none came), and exits, its standard error saying nothing is published in {room} when none is; --watch keeps printing + {path} and - {path} as paths come and go |
tablebox read {room}/{kind}/{name}/{id} [--track {name}] |
Prints a broadcast's catalog, then a line for each group or value of each track it lists; --track {name} prints one track's values instead, such as --track value for a state, or --track records for a log, which prints its window as frames arrive: each group's first frame, {offset, records}, then that object with each later frame ({"push": {at, value}} or {"pop": n}) merged into it |
tablebox status [--since {time}] |
Prints what Manager and every Relay answer at GET /status, which needs no key: Manager at its address, and the Relays a Relay to start from lists. --since (RFC 3339) adds each one's history from then. Exits with 1 when a server gives no answer or answers other than 200 |
tablebox --version, tablebox help [{command}] |
The version; usage |
ls and read sign a token that only reads with the folder's key, and connect to a Relay as a participant, with a new ID each run; with token and status, they need no Manager. init, claim, key and api call Manager, and fail while it is down (503 unavailable, Manager is not answering): run them again once it is back.
init and status call Manager at TABLEBOX_MANAGER_URL and start from the Relays of TABLEBOX_RELAY_URL (separated by commas), pinning their certificate by TABLEBOX_RELAY_CERT_SHA256, each from the environment when set there, else the hosted service's values built into the CLI; the certificate's SHA-256 is never built in. init writes those values into TABLEBOX_KEY, and every other command takes them from it: leave them unset unless you run Tablebox yourself, since a value left set in a shell changes where init makes the project.
tablebox api GET /projects/{project}
tablebox api PATCH /projects/{project} '{"limits": {"connections": 10}}'
tablebox api GET /projects/{project}/keys
tablebox api DELETE /projects/{project}/keys/{key}.env.local
tablebox init appends one line to .env.local in the app's folder, creating it when there is none, and tablebox key replaces it, leaving every other byte of the file as it was. The line is TABLEBOX_KEY, the folder's key: an Ed25519 private key as a JWK on one line, {"kty", "crv", "x", "d", "alg", "kid"} with alg EdDSA and kid the key's ID (tb_…), and also project, the project's ID; relays, the Relays its tokens start from; and manager, Manager's address, which remove calls; its members sorted by name. It is the only secret in .env.local: keep .env.local out of version control and out of the folder you serve.
Management API
The API is Manager's, at /v1 at the Manager API address (the hosted service), with JSON bodies. A call is made as a key of the project its path names, with a management token that key signed, Authorization: Bearer {token}, as the CLI and remove call it; a person's Console session reads a project they own, and changes nothing. Manager writes each change to the Relays at the moment of the call, and answers once they took it: a Relay's refusal is the call's answer, and so is unavailable when no Relay answers. It passes reads of a project to a Relay too, and answers owners and usage per day itself. The Relays take management calls from the operator alone.
| Call | Body | Result | Credential |
|---|---|---|---|
POST /projects |
{name, jwk}: the project's first key, its public key |
Project, and key, the Key: a temporary project |
None; tablebox init makes it so |
GET /projects |
[Project]: the projects you own |
Console's session | |
GET /me |
{id, name}: your user ID and your GitHub login |
Console's session | |
GET, PATCH, DELETE /projects/{p} |
{name?, limits?} |
Project | A management token, or for GET Console's session |
POST /projects/{p}/claim |
{claimed: false, url, code, expires}: an address on Console and a code, replacing the last; or, once someone owns it, {claimed: true, owners: [Owner]} |
A management token | |
GET /claims/{code}, POST |
{project: {id, name}, expires}; Project, of which you are now the owner |
Console's session | |
GET /projects/{p}/owners |
[Owner] |
A management token, or Console's session | |
POST /projects/{p}/owners |
{user}: the GitHub login or user ID of a person who has signed in |
Owner | A management token |
DELETE /projects/{p}/owners/{user} |
A management token | ||
GET /projects/{p}/keys, POST |
{jwk} |
[Key], Key |
A management token, or for GET Console's session |
DELETE /projects/{p}/keys/{id} |
A management token | ||
GET /projects/{p}/removals, POST |
{sub, path?}: a user or an ID, and a room |
[{sub, path, at}], the removal |
A management token, or for GET Console's session |
GET /projects/{p}/closings, POST |
{path}: a room |
[{path, at}], the closing |
A management token, or for GET Console's session |
GET /projects/{p}/usage?from={day}&to={day} |
[{day, bytesIn, bytesOut, peakConnections}] |
A management token, or Console's session |
- Project:
{id, name, created, expires, limits: {monthlyBytes, connections}, ceilings: {monthlyBytes, connections}, state, usage: {month, bytesIn, bytesOut}, lastMonth, connections}.idis 12 characters froma–z 0–9.expiresis when the Relays delete a temporary project, andnullfor a project someone owns. A limit is a number, ornullwhen not set, and then the ceiling applies; the ceilings are the operator's (Ceilings).stateisrunning,fullorstopped.usageis this UTC month's (monthisYYYY-MM), summed over every Relay as the Relay answering has heard it, andlastMonththe month before's;connectionsis the connections open now. - Owner:
{id, name, added}: the person's user ID (usr_…), their GitHub login, and when they became an owner. A person can be added once they have signed in, and adding an owner again changes nothing. A project keeps at least one owner: removing the last is refused withconflict. - Key:
{id, alg, jwk, created}:jwkis the public key as the Relays keep it, withalg. - Conventions: Lists are oldest first. A deleted project or key stays deleted: it is never listed again, and its ID is never used again.
DELETEanswers 204 with no body.PATCH /projects/{p}takesnameandlimitsalone, and changes only what it gives;nullremoves a limit, leaving the ceiling. Apathis a room, with no wildcard, and an empty or omittedpathis the whole project. Times are RFC 3339 in UTC, anddayisYYYY-MM-DDin UTC.usagelists only days with usage. - Keys: an Ed25519 key pair you make, of which Manager and the Relays get only the public key, as exactly the JWK
{"kty": "OKP", "crv": "Ed25519", "x"},xin unpadded base64url; the Relay keeps it withalgEdDSA. It refuses withbad-requesta JWK with a private part (d) or any other member, and a point that does not decode or is of small order (which no key pair makes). It gives the key its ID,tb_and 20 random characters fromA–Z a–z 0–9, which names the key across all projects. The private key never reaches Manager or a Relay: the CLI writes those it makes into.env.local.
Errors
Errors are HTTP statuses with {"code", "message"}, as Manager answers them, or as a Relay answered Manager:
| Code | Status | When | What to do |
|---|---|---|---|
bad-request |
400 | A malformed body; a limit above its ceiling; ceilings or expires in a change, which are the operator's; or a path written with % |
message names the field |
unauthenticated |
401 | No credential, or one not accepted: a management token that is not a JWT, names a key the project does not have, is signed badly or is outside its form (message says which, management token: …); a call that takes Console's session, such as GET /projects, made with a management token; a change made with Console's session; a session that ended |
Check the key and the management token's header and claims; sign in to Console again |
suspended |
403 | Signing in to Console as a person the operator suspended, which goes back to Console with error=suspended; adding an owner to a project whose every owner is suspended |
Ask the operator |
not-found |
404 | A project the Relays do not hold: never made, deleted, or a temporary one past its deletion time; with Console's session, a project you do not own; a claim's code unknown or ended; adding as an owner a login or user ID nobody has signed in with | Check the project's ID and the credential; for an ended claim, run tablebox claim again; a person to add signs in once first |
conflict |
409 | Claiming a project someone owns, or one less than a minute before its deletion time; adding an owner to a temporary project; removing a project's last owner | tablebox claim names the owners; a project past its deletion time is gone, so run tablebox init again. Claim a temporary project instead. Add another owner first, or delete the project |
limit |
429 | A ceiling refuses a claim, or adding an owner who owns as many projects as it lets them; message names it |
Delete a project you no longer need, in its folder with tablebox api DELETE /projects/{project}, or ask the operator |
busy |
503 | POST /projects with no session (tablebox init) while Tablebox holds as many temporary projects as it takes: Tablebox is busy now: try again later |
Try again later |
unavailable |
503 | Manager is not answering (Manager is not answering: try again once it is back); no Relay answered Manager, or GitHub did not answer for a sign-in; or a change got no answer from the Relay it was sent to, which may have made it (… may have made it: read it to see) |
Try again later; after a change that may have been made, read what it changed first |
internal |
500 | Try again later |
Management tokens
A management token is how the CLI, your backend or your own program calls Manager as one of a project's keys. It is a JWT signed with the key's private key, sent as Authorization: Bearer {token} with a call whose path names the key's project, /projects/{p} or below it. Its header is {"alg", "kid"}: the key's alg and its ID. It holds exactly these claims:
| Claim | Type | Meaning |
|---|---|---|
aud |
string, required | manager |
iat |
seconds, required | When it was signed, at most 60 s ahead of Manager's clock |
exp |
seconds, required | In the future, and at most 600 s after iat |
Manager reads the project's public keys from a Relay, and refuses with unauthenticated a token with any other claim, without kid or naming a key the project does not have, whose header's alg is not the key's (HS256 and none among them), signed badly, or past its exp; message says which. A management token admits no connection, since a Relay refuses a token with aud.
// Shows how a program manages its project with the folder's key: it sets a limit, turns a user out
// of a room, closes a room and reads this month's usage.
//
// The key is TABLEBOX_KEY, which names the project and Manager, through which every change goes.
// `remove` turns a user out of a room and the rooms below, or closes them with no user. The other
// calls carry a management token the key signs, its header naming the key's alg and ID, with the
// claims aud (`manager`), iat and exp alone. Needs jose (npm install jose).
import { importJWK, SignJWT } from 'jose';
import { remove } from 'tablebox.io/server';
const key = JSON.parse(process.env.TABLEBOX_KEY!);
/** Calls Manager for the key's project, with a management token valid for two minutes. */
async function call(method: string, path: string, body?: unknown) {
const token = await new SignJWT()
.setProtectedHeader({ alg: key.alg, kid: key.kid })
.setAudience('manager')
.setIssuedAt()
.setExpirationTime('2m')
.sign(await importJWK(key));
const reply = await fetch(new URL(`/v1/projects/${key.project}${path}`, key.manager), {
method, headers: { authorization: `Bearer ${token}`, 'content-type': 'application/json' }, body: JSON.stringify(body),
});
if (reply.ok) return reply.status === 204 ? undefined : reply.json();
const { code, message } = await reply.json();
throw new Error(`Manager answered ${reply.status} ${code}: ${message}`);
}
await call('PATCH', '', { limits: { connections: 10 } });
await remove(process.env.TABLEBOX_KEY!, { user: 'mallory', room: 'rooms/42' });
await remove(process.env.TABLEBOX_KEY!, { room: 'rooms/41' });
console.log('closed rooms/41');
console.log((await call('GET', '')).usage);Token claims
A token is a JWT signed with a project key's private key. Its header is {"alg", "kid"}: EdDSA and the key's ID. A Relay refuses any other alg, HS256 and none among them. sign of tablebox.io/server makes such a token. With jose 6, give the header the key's alg as it is: jose also signs an Ed25519 key with the alg Ed25519, which a Relay refuses. A token holds these claims and no others:
| Claim | Type | Meaning |
|---|---|---|
room |
pattern, required | The rooms it lets in: a room, or a pattern of rooms such as shows/* or ** |
publish |
boolean, default false |
Whether it publishes in its room as well as reads |
sub |
user, optional | The user your backend checked: 1 to 64 printable ASCII characters other than space, /, * and ~, not starting with .. The connection's ID is {sub}~{the tab's}. Without it (or with null), the token is for pages |
iat |
seconds, required | When it was issued, at most 60 s ahead of the Relay's clock. Removals and closings compare it |
exp |
seconds, required with sub, optional without |
Checked when a connection is admitted |
relays |
URLs, required by the SDK | The Relays to start from, https URLs |
hashes |
strings, optional | SHA-256s, in hex, of a Relay certificate no authority signed; the hosted service needs none |
Patterns follow moq-pattern: /-separated segments, each a literal, * (one whole segment), prefix*suffix (one segment) or ** (any number of segments, at most once). shows/* matches shows/1 but not shows/1/x, and ** every room. Any other claim refuses the token, aud among them, so a management token admits no one.
Close codes
connection.reason.name gives the code's name. After most codes the connection turns closed. After unavailable, after expired with a function, and after a refusal with full or stopped as it connects, the SDK connects again, and status stays connecting until it is in. A Relay refuses a connection by opening it and closing it at once with the code, so a refused connection may show connected for a moment. The SDK writes each code it gets to the console once, as tablebox.io: {name} ({code}), closed: … or …, connecting again: …, and again when the connection closes with it.
To find the cause, run tablebox ls {room} in the app's folder. When it fails with the same code as your app, the cause is in the project or the folder's key. When it works and your app does not, the cause is in your app's token. {project} below is the project's ID, project of TABLEBOX_KEY.
| Code | Name | When | What the SDK does | What to do |
|---|---|---|---|---|
| 64 | invalid-token |
The token is malformed, signed with a key the Relays do not know or deleted, signed badly or with another alg than its key's, carries a claim other than those listed, lacks room or iat, has sub without exp or a sub that is not a user, or iat more than 60 s ahead; it comes without a secret or with a malformed one; or it does not let the connection into its room. For a new connection, also when its project was deleted, as a temporary one is at its deletion time |
Stops; given a function, a connection closed with it after it had been open tries once more with a new token; given a token, a refusal before the Relay admitted any session is tried again until 10 s after connect(), since a key just made reaches the Relays within seconds |
Sign with the folder's key, the header's alg and kid the key's, with only those claims. A token whose key was deleted, as tablebox key deletes the folder's old one, stays refused: make another with tablebox token or sign. For a deleted project, remove the TABLEBOX_KEY line from .env.local and run tablebox init again |
| 65 | expired |
exp has passed |
Connects again with a token from the function; given a token, stops | When it comes again and again, your backend signs tokens already expired: check its clock and exp |
| 66 | removed |
A removal covers the connection's ID, or its user, in its room | Stops | tablebox api GET /projects/{project}/removals. Tokens issued at or before the removal's second stay refused; a token issued in a later second is admitted |
| 67 | path-closed |
A closing covers the connection's room, or the project was deleted while the connection was open, as a temporary one is at its deletion time | Stops | tablebox api GET /projects/{project}/closings. Tokens issued at or before the closing's second stay refused. For a deleted project, run tablebox init again as for invalid-token |
| 68 | full |
The project has as many connections as its connection limit, for a new connection | Waits and connects again | tablebox api GET /projects/{project} shows connections, state, limits and ceilings. Close connections your app no longer uses, or raise the limit, up to the ceiling. A temporary project's ceilings are small, and claiming it raises them (Get started). The SDK connects once there is room |
| 69 | unavailable |
This Relay is starting or shutting down | Moves to the next Relay | Nothing. A project or key created a moment ago reaches every Relay within a second |
| 70 | stopped |
This month's bytes in and out reached the project's monthly limit | Stops when it closes an open connection; waits and connects again when it refuses one | tablebox api GET /projects/{project} shows usage, state, limits and ceilings. Wait for the month's end or raise the limit, up to the ceiling (tablebox api PATCH /projects/{project} '{"limits": {"monthlyBytes": null}}' leaves the ceiling); a ceilings.monthlyBytes of 0 is the operator stopping it, or suspending every owner. A temporary project's ceilings are small, and claiming it raises them (Get started) |
A connection that is connected but gets nothing from someone has no code. tablebox ls {room} lists whether they publish the name; then check the room and the rights (Connecting, Tokens and rights) and, with { from }, the ID. tablebox read shows whether values or media groups arrive.
A connection that stays connecting with no reason has reached no Relay, so there is no code to give: check the network, and the token's relays.
Limits and time bounds
| Value | What |
|---|---|
| 1 MiB | A value or a record, as JSON |
| 100 records, 1 MiB | What each person's log keeps for those who come later, the newest record always; every reader gets it again with the next record after 2 s without one |
| 10 s; 30 s | A silent connection ends, over WebTransport; over WebSocket. A person whose connection dropped leaves then |
| 10 s | Files.fetch waits for someone who shares the file, and for each of them to answer, then rejects with file {hash}: nobody here gave it |
| 10 s; 20 s | Usage shows in a project's usage at a Relay; in the usage per day |
| About 1 GB | Receiving one video for an hour, counted in the monthly bytes |
| 72 h | A temporary project lives from tablebox init until every Relay deletes it, unless claimed |
| 15 min | A claim's code, from tablebox claim |
| 10 min | A management token at most |
Ceilings
The operator sets ceilings around the limits you set: how many projects a person may own, counting those not deleted, and each project's monthly bytes and connections. A claim, or adding an owner, past a ceiling is refused with limit. The operator may set one person's projects ceiling, or one project's ceilings, apart from the rest. Manager writes a project's ceilings to the Relays when it makes or a person claims the project, and when the operator changes them or suspends its owners; they have no end, and the Relays keep them while Manager is down. A temporary project's are small, and nobody's projects ceiling counts it. Manager's defaults, which the hosted service may set lower:
| Ceiling | Default |
|---|---|
| Projects a person owns | 3 |
| Monthly bytes per project someone owns | 100 GB |
| Connections per project someone owns | 100 |
| Monthly bytes per temporary project | 1 GB |
| Connections per temporary project | 10 |
| Temporary projects at once, across Tablebox | 1,000; past it, tablebox init is answered busy |
The hosted service
The values the operator publishes for the hosted service:
| Value | |
|---|---|
| Relay URL, the Relays to start from | https://relay-a.stg.tablebox.io/,https://relay-b.stg.tablebox.io/ |
| Manager API address | https://manager.stg.tablebox.io |
| Console address | https://console.stg.tablebox.io |
The folder of the CLI's install scripts, install.sh and install.ps1 |
https://www.stg.tablebox.io/cli/ |
| The SDK's package: a name npm installs, or the address of its tarball | https://www.stg.tablebox.io/sdk/tablebox.io-0.1.0-6e04b9a1e8b9.tgz |