Spatio.Api.Realtime (spatio_sdk v0.0.2)
API calls for all endpoints tagged Realtime.
Summary
Functions
Exchange a bearer token for a short-lived Yjs collaboration JWT.
The Yjs Cloudflare Worker that powers live document collaboration (wss://realtime-collaboration.<account>.workers.dev) only accepts platform-signed JWTs. Third-party clients holding an OAuth access token or PAT call this endpoint to mint a 5-minute collaboration JWT they can present to the worker. The minted JWT inherits user + workspace identity from the presenting bearer token. Optionally scope it to a single room by supplying room in the request body.
Functions
@spec issue_collaboration_token( Tesla.Env.client(), keyword() ) :: {:ok, nil} | {:ok, Spatio.Model.IssueCollaborationToken200Response.t()} | {:error, Tesla.Env.t()}
Exchange a bearer token for a short-lived Yjs collaboration JWT.
The Yjs Cloudflare Worker that powers live document collaboration (wss://realtime-collaboration.<account>.workers.dev) only accepts platform-signed JWTs. Third-party clients holding an OAuth access token or PAT call this endpoint to mint a 5-minute collaboration JWT they can present to the worker. The minted JWT inherits user + workspace identity from the presenting bearer token. Optionally scope it to a single room by supplying room in the request body.
Parameters
connection(Spatio.Connection): Connection to serveropts(keyword): Optional parameters:body(IssueCollaborationTokenRequest):
Returns
{:ok, Spatio.Model.IssueCollaborationToken200Response.t}on success{:error, Tesla.Env.t}on failure