Constructor
Two overloads:init(). Omit it and the avatar isn’t rendered until you call attachDOMNode().
Optional first positional argument. When passed, the avatar renders into this element on
init(). Without it, call attachDOMNode() before rendering becomes visible.Config
Per-session token from
POST /api/v1/sessions. Must be minted on your backend.Requests microphone access and routes the user’s voice into the conversation engine. Required for voice-to-voice flows (OpenAI Realtime, Cartesia).
Starts the session with the microphone muted. Defaults to the opposite of
audioSource — voice-to-voice sessions start unmuted, text-echo sessions start muted.Joins the avatar room as soon as
init() resolves. Set to false if you need a manual gap between init and join — then call join() yourself.Fetches the SDK runtime bundle eagerly. Reduces first-interaction latency at the cost of an extra network request on page load.
Opens the stream connection before
init() completes. Trades a small amount of bandwidth for faster time-to-first-frame.Keeps the local SDK state alive during user inactivity. With the default (
false), the SDK tears down its local Daily call object after 5 minutes idle and emits the idle event. The backend session terminates separately via user_absent_timeout.Override the API host. Rarely needed — when set, expose both
${apiHost}/api/v1 and ${apiHost}/_sdk/v0 (see Under the hood).