OptionalanalyticsWhat the SDK reports about the session, and where it goes.
See AnalyticsOptions. Reporting is on unless you turn it off with
analytics: { enabled: false }.
Credentials used for every request the SDK makes on the application's behalf.
Use { type: 'key', clientKey } in a browser: a client key is scoped to one agent and to
the domains you allowed, so it is the only shape that is safe to ship in a page. See
Auth.
OptionalbaseBase URL of the D-ID Agents API.
Advanced. Points the SDK at another D-ID environment. Production applications do not set this. Every REST call the manager makes — agent lookup, chat, ratings, stream creation — is addressed against it.
Handlers the SDK calls as the connection, the video stream and the chat change state.
See AgentManagerCallbacks. onSrcObjectReady is what connects the streamed media to your video element, so every chat mode that streams video needs it. The handlers are captured at creation, so replacing one on this object later has no effect.
OptionaldebugWhether the SDK logs its streaming lifecycle to the browser console.
It is also switched on for everyone when the agent's ui_debug_mode advanced setting is
enabled, regardless of the value passed here.
OptionalexternalYour own identifier for the end user.
It is stored in localStorage, sent as part of the type: 'key' authorization header and
attached to analytics, so the same visitor is recognized across page loads. When it is
omitted the SDK generates an id and reuses it.
OptionalinitialMessages the chat starts with, for example a transcript restored from your own storage.
They are delivered to onNewMessage so the UI can render them. On Talks (V2) and Clips (V3) agents they are also sent as context with the next chat() request. See Message.
A row from your own storage is enough: parts and
createdAt are optional, and the SDK builds the parts from
content with parseMessageParts for every message that arrives without them, so a
transcript restored from the text alone still renders. A non-empty parts array is kept as
given.
OptionalmodeHow the agent answers: with a streamed video, as text only, or not at all.
See ChatMode. It can be changed later with changeMode(). ChatMode.Off and ChatMode.DirectPlayback are supported on Talks (V2) and Clips (V3) agents only.
ValidationError From createAgentManager, when the agent is Expressive (V4) and the mode is ChatMode.Off or ChatMode.DirectPlayback.
OptionalpersistentWhether the server keeps the chat so it can be resumed in a later session.
Without persistence a chat lives only as long as the connection. reconnect() normally continues the same chat either way — see the caveat there for Expressive (V4) agents.
Off unless you set it, on every agent type.
OptionalstreamTransport settings applied when the stream is created.
See StreamOptions. Talks (V2) and Clips (V3) agents only. Expressive (V4) agents manage transport settings automatically.
OptionalverboseWhether the stream is created in verbose mode, which logs more server-side detail.
Independent of debug: this one is sent to the streaming service rather than controlling console output. Expressive (V4) agents only.
OptionalwsURL of the D-ID notifications web socket.
Advanced. Points the SDK at another D-ID environment. Production applications do not set this. Only opened in the chat modes that stream the agent's answer, so it has no effect in DirectPlayback or Off.
Everything createAgentManager needs to reach an agent and report back to the application.
auth and callbacks are required; the rest have defaults that suit a browser application talking to D-ID production.
createAgentManager reads the object once, at creation, and never writes to it: the manager works from its own copy, so one options object can create two managers, and a property you read back afterwards is still the one you set. The same means a handler assigned to callbacks after the manager exists is not picked up — give the callback a stable identity and dispatch inside it instead.