Tabs & Spaces Developers

Reference

Tokens

A Custom tab's token is a JWT (RFC 7519), signed with EdDSA (Ed25519). It's valid for ten minutes.

json
{ "alg": "EdDSA", "typ": "JWT", "kid": "q3Xr9tL2mVb7Hc1d" }

kid is the id of the deployment key that signed it.

Claims

ClaimWhat it is
issThe deployment's public address, like https://chat.acme.com
audYour app's origin, like https://crm.example.com
subThe user's id (also in ctx.user.id)
iatWhen it was issued, in seconds since the epoch
expWhen it expires: iat + 600
ctxWho's looking, and where: the same TabContext your page is told. See What you're told.
json
{
  "iss": "https://chat.acme.com",
  "aud": "https://crm.example.com",
  "sub": "6acf…",
  "iat": 1792058400,
  "exp": 1792059000,
  "ctx": {
    "user": { "id": "6acf…", "name": "Ada Lovelace" },
    "workspace": { "id": "6abe…", "slug": "acme", "name": "Acme" },
    "space": { "id": "uib59teu0eq9", "kind": "normal", "name": "Launch" },
    "tab": { "id": "vuuxldzm", "appTabId": "contacts" },
    "app": { "id": "acme-crm" },
    "locale": "en"
  }
}

Keys

GET /api/apps/keys on the deployment's address returns its public keys as a JWK set. It needs no sign-in, and may be cached for an hour.

FieldValue
ktyOKP
crvEd25519
xThe public key, base64url
kidIts id, matching tokens' kid
algEdDSA
usesig

Every workspace on a deployment shares its keys, so a token's ctx.workspace tells you which workspace it's for. Keys change only when the deployment's owner changes its secret.

Where tokens come from

Only the workspace's web app can get a token, for someone signed in who can see the space the tab is in. Each token is addressed to one app's origin, so a token for another app doesn't work on yours.