Skip to main content
The @odysseyml/odyssey package provides a TypeScript/JavaScript client for interacting with Odyssey’s audio-visual intelligence.
FeatureMinimum Version
Core SDK^0.3.0
Recordings^0.2.0

Installation

npm install @odysseyml/odyssey

API Summary

Methods

SignatureDescription
connect(handlers?): Promise<MediaStream>Connect to a streaming session (returns MediaStream when ready)
disconnect(): voidDisconnect 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): HTMLVideoElementAttach 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

PropertyTypeDescription
isConnectedbooleanWhether connected and ready
currentStatusConnectionStatusCurrent connection status
currentSessionIdstring | nullCurrent session ID
mediaStreamMediaStream | nullVideo stream from streamer
connectionStateRTCPeerConnectionState | nullWebRTC connection state

Event Handlers

HandlerParametersDescription
onConnectedmediaStream: MediaStreamVideo stream established
onDisconnected-Video stream closed
onStreamStartedstreamId: stringInteractive stream ready (streamId can be used for recordings)
onStreamEnded-Interactive stream ended
onInteractAcknowledgedprompt: stringInteraction processed
onStreamErrorreason, messageStream error occurred
onErrorerror: Error, fatal: booleanGeneral error
onStatusChangestatus, message?Connection status changed

Next Steps