D-ID Client SDK - v3.0.0-0
    Preparing search index...

    Interface AgentManagerOptions

    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.

    interface AgentManagerOptions {
        analytics?: AnalyticsOptions;
        auth: Auth;
        baseURL?: string;
        callbacks: AgentManagerCallbacks;
        debug?: boolean;
        externalId?: string;
        initialMessages?: Message[];
        mode?: ChatMode;
        persistentChat?: boolean;
        streamOptions?: StreamOptions;
        verbose?: boolean;
        wsURL?: string;
    }
    Index
    analytics?: AnalyticsOptions

    What the SDK reports about the session, and where it goes.

    See AnalyticsOptions. Reporting is on unless you turn it off with analytics: { enabled: false }.

    auth: Auth

    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.

    baseURL?: string

    Base 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.

    D-ID's production Agents API.
    

    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.

    debug?: boolean

    Whether 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.

    false
    
    externalId?: string

    Your 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.

    initialMessages?: Message[]

    Messages 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.

    const initialMessages = stored.map(({ id, role, content }) => ({ id, role, content }));
    
    mode?: ChatMode

    How 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.

    ChatMode.Functional
    

    ValidationError From createAgentManager, when the agent is Expressive (V4) and the mode is ChatMode.Off or ChatMode.DirectPlayback.

    persistentChat?: boolean

    Whether 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.

    false
    
    streamOptions?: StreamOptions

    Transport settings applied when the stream is created.

    See StreamOptions. Talks (V2) and Clips (V3) agents only. Expressive (V4) agents manage transport settings automatically.

    verbose?: boolean

    Whether 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.

    false
    
    wsURL?: string

    URL 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.

    D-ID's production notifications web socket.