Package: @onesay/sdk; license: Apache-2.0.
Environments
Each environment has its own Control API and Realtime WebSocket endpoint.
| Environment | Control API | Realtime WebSocket |
|---|---|---|
| Production | https://api.onesay.com/v1 | wss://realtime.onesay.com/v1 |
To reach another regional node, call setCustomEndpoints with the addresses from your configuration and use environment: "custom".
Room events
Each SDK event name and the OneSay event it reports.
Connected->room.connectedDisconnected->room.disconnectedReconnecting->room.reconnectingReconnected->room.reconnectedParticipantJoined->participant.joinedParticipantLeft->participant.leftSignalOpened->signal.openedSignalEnded->signal.endedError->error
Task events
Each SDK event name and the OneSay event it reports.
Created->task.createdStarted->task.startedTranscriptPartial->artifact.deltaTranscriptFinal->artifact.finalizedCompleted->task.completedFailed->task.failedCancelled->task.cancelled
In the browser the SDK authenticates only through the token provider you supply, never with a secret key. Task voice sends the audio you pass in, 16000 Hz mono pcm_s16le; the SDK does not open a microphone for it and never drops audio silently. Helpers convert sample buffers.
Task voice
- Entry points:
client.tasks.create,client.tasks.get,client.tasks.list,client.tasks.cancel,RealtimeClient - Transport: onesay.realtime.v1 WebSocket with canonical PCM frames, contiguous ACK, unacked-only replay and bounded resume
- Results: Task and Artifact readback
Realtime RTC
- Entry points:
client.rtc.connect,client.rtc.get,client.rtc.revoke,client.rtc.endPublication,client.rtc.agents.create,client.rtc.agents.get,client.rtc.agents.stop - Transport: OneSay RTC session over the locked native SDK, loaded lazily on the first RTC operation
- Results: publications, subscriptions, packets, streams, RPC, data tracks and explicit Agent executions
RTC session states
connectedreconnectingclosed
The session state is what this client observes. The server decides every authorization, and a revocation is complete only when the server reports it.
Capabilities
| Capability | Support | Detail |
|---|---|---|
| Task voice (WSS, ACK, replay, resume) | supported | Supported (browser, Node) |
| RTC audio | supported | Publish, subscribe, mute, playback (browser) |
| Packets | supported | Send and receive |
| Streams | supported | Send and receive |
| RPC | supported | Call and handle |
| DataTrack | supported | Supported (livekit-client 2.22.3) |
| Agents | supported | Explicit Agent executions and read-only Agent state |
| State, device, error, release | supported | Session state, quality, microphone selection, OneSay errors, close |
| Selected-mode media encryption | conditional | Conditional: where the browser can run the packaged worker |
Not exposed: native room, track and participant objects; native token or connection material; native SDK types; an escape hatch to the native SDK. An unsupported capability fails with an explicit error.