@odysseyml/odyssey package provides a TypeScript/JavaScript client for interacting with Odyssey’s audio-visual intelligence.
| Feature | Minimum Version |
|---|---|
| Core SDK | ^0.3.0 |
| Recordings | ^0.2.0 |
Installation
API Summary
Methods
| Signature | Description |
|---|---|
connect(handlers?): Promise<MediaStream> | Connect to a streaming session (returns MediaStream when ready) |
disconnect(): void | Disconnect and clean up resources |
startStream(prompt, portrait?): Promise<string> | Start an interactive stream |
interact(prompt): Promise<string> | Send a prompt to update the video |
endStream(): Promise<void> | End the current stream session |
attachToVideo(element): HTMLVideoElement | Attach stream to a video element |
getRecording(streamId): Promise<Recording> | Get recording URLs for a stream (v0.2.0+) |
listStreamRecordings(options?): Promise<StreamRecordingsListResponse> | List user’s stream recordings (v0.2.0+) |
Properties
| Property | Type | Description |
|---|---|---|
isConnected | boolean | Whether connected and ready |
currentStatus | ConnectionStatus | Current connection status |
currentSessionId | string | null | Current session ID |
mediaStream | MediaStream | null | Video stream from streamer |
connectionState | RTCPeerConnectionState | null | WebRTC connection state |
Event Handlers
| Handler | Parameters | Description |
|---|---|---|
onConnected | mediaStream: MediaStream | Video stream established |
onDisconnected | - | Video stream closed |
onStreamStarted | streamId: string | Interactive stream ready (streamId can be used for recordings) |
onStreamEnded | - | Interactive stream ended |
onInteractAcknowledged | prompt: string | Interaction processed |
onStreamError | reason, message | Stream error occurred |
onError | error: Error, fatal: boolean | General error |
onStatusChange | status, message? | Connection status changed |