Stream session events (actions, command output)
client.computers.retrieveEvents(stringid, RequestOptionsoptions?): void
GET/computers/{id}/events
Server-Sent Events stream carrying non-video events for a session. Each data: line is a JSON object describing one event. Three event categories are emitted:
- Action requests — an action has been queued for execution.
- Action responses — a previously requested action has completed. Includes a
request_idfor correlation; for shell commands, also includesexit_code,stdout, andstderr. - Command output chunks — streaming output from a long-running shell command started with
/exec. Each chunk includesrequest_id, base64-encodeddata, and anis_stderrflag.
Video and cursor traffic is delivered on /computers/{id}/screencast instead and is deliberately excluded from this stream so high-frequency frame data doesn't drown out action responses.
On stream-setup failure the server emits a single event: error SSE event and closes the connection.
Parameters
id: string
Stream session events (actions, command output)
import Lightcone from '@tzafon/lightcone';
const client = new Lightcone({
apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted
});
await client.computers.retrieveEvents('id');