Skip to content

WebSocket Requests ​

Requests you send to the server. Each is a JSON object with an action and, for most actions, a data object shaped to match it.

generate-auth-code action ​

Starts signing a user in to your application. The server replies with an application-auth-code event carrying a code for the user to redeem, then an application-auth-code-redeemed event once they have. Problems are reported with an application-auth-code-error event.

The same request is available over HTTP as POST /auth/application/code.

appIDstring

The ID of the application requesting authorization.

scopes?('profile:read' | 'session:read' | 'session:write' | 'session:control' | 'effect-request:write' | 'pubsub.public:read' | 'pubsub.private:read' | 'token:extend' | 'menu:read' | 'menu:write' | 'custom-effects:write' | 'custom-effects:read' | 'default-effect:write' | 'instance:write' | 'goal:read' | 'goal:write' | 'notification:read' | 'notification:write' | 'signals:effects' | 'signals:overlay')[]

The scopes the user is asked to grant. Defaults to every scope the application is permitted when omitted.

packs?string[]

The game packs the token is limited to. Defaults to every pack the application is permitted when omitted.

qrCode?boolean

Also return the code's URL as a QR code, encoded as a PNG data URL.

codeChallenge?string

PKCE code challenge, base64url(sha256(code_verifier)). Required for public applications, rejected for applications that redeem codes with a secret.

codeChallengeMethod?'S256'

The PKCE challenge method. Currently only S256 is supported.

subscribe action ​

Asks the server to start sending you events from the given topics. Requires token or key.

The server replies with a subscription-result event listing which topics were accepted.

topicsreadonly PubSubEventTopic[]

The topics to subscribe to.

token?string

A complete JWT auth token.

key?string

A partial token obtained from the Overlay URL, with limited backend access.

signalToken?string

A custom app's signal token (issued when the streamer approved its signal code): authenticates that one app for the Signals topics only. Accepted on the socket and nowhere else.

Identifies the connecting application, for diagnostics.

unsubscribe action ​

Asks the server to stop sending you events from topic, or from every topic you are subscribed to when topic or data is omitted. The server does not reply.

The topic to leave. Leave it out to leave every topic this connection joined.

rpc action ​

Invokes an action against a user, almost always their running game session. The action itself is the call object — see RPC calls for the available methods.

token?string

A complete JWT auth token. Optional only when signalToken is given.

signalToken?string

A custom app's signal token: the app answering its own effects (see subscribe).

ping action ​

Keeps the connection alive. Idle connections are closed by the server after 10 minutes, so send this when it's been ~9 minutes since the last message from either side.

The server replies with the plain text message pong rather than a JSON event.

This request takes no data.

whoami action ​

[Deprecated] Asks the server for your connectionID. Used for the old login process; expect this to be removed or locked down in the future.

The server replies with a whoami event.

This request takes no data.