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

      D-ID Client SDK - v3.0.0-0

      Getting started — This guide takes a blank browser application to a connected agent that answers a question and says a scripted line.
      Chat modes — The chat mode decides how the agent answers: with a streamed video, as text only, or not at all.
      Client tools — A client tool is a function that runs in the user's browser when the agent's LLM decides to call it.
      Expressive media — An Expressive (V4) session is two-way: the page can publish the user's microphone and camera, interrupt the agent, and send its own data-channel messages.
      Handling errors — Every error the SDK raises is a BaseError carrying a kind, and isDIDError is the guard that recognizes one.
      Migration guide — @d-id/client-sdk v3 is a breaking release that trims the package's public surface to what the SDK supports.
      createAgentManager — Creates an AgentManager for one agent: its chat, its video stream and its connections.
      Agent — An agent's profile, as the Agents API returns it.
      AgentAvatar — The avatar an agent speaks through: its rendering tier and the language of its voice.
      AgentManager — A live connection to one agent: its profile, its chat, and the video stream it answers on.
      AgentManagerOptions — Everything createAgentManager needs to reach an agent and report back to the application.
      AnalyticsOptions — What the SDK reports about the session, and where it goes.
      EndOfCallFeedbackConfig — The end-of-call feedback form configured on an agent.
      SttTokenResponse — A short-lived credential for the D-ID speech-to-text service.
      AvatarType — The kind of avatar an agent is built on, which is what decides how its video is produced.
      DataChannelTopic — The data-channel topics an application may send on with sendDataChannelMessage().
      BearerToken — A bearer token for the Agents API.
      ClientKeyAuth — A client key for the Agents API — the credential to use in a browser.
      Auth — The credentials createAgentManager accepts, as options.auth.
      BasicAuth — HTTP basic credentials for the Agents API, given either pre-encoded or as a username and password.
      isAwaitingTool — Whether the agent is waiting on a tool call before it can continue.
      AgentManagerCallbacks — Handlers the SDK calls as the connection, the video stream and the chat change state.
      ErrorContext — What the SDK knows about where a failure happened, beyond the error itself.
      RunningToolCall — A tool call currently running in the session.
      StreamCreatedInfo — Identifiers of the stream the SDK has just opened for the session.
      ToolCallDonePayload — The payload of a ToolCallEvent.Done event: a tool call finished successfully.
      ToolCallErrorPayload — The payload of a ToolCallEvent.Error event: a tool call failed.
      ToolCallStartedPayload — The payload of a ToolCallEvent.Started event: the agent has begun a tool call.
      ClientToolHandler — A client tool's implementation: the function that runs in the browser when the agent calls it.
      ToolEventCallback — The handler type for onToolEvent: the event argument narrows the payload argument.
      ToolExecutionMode — Whether the agent waits for a tool call to finish before it carries on.
      AgentActivityState — What the agent is doing right now, for driving the application's UI.
      ConnectionState — The state of the connection between the browser and the agent's stream.
      ConnectivityState — How well the streamed media is reaching the user.
      StreamEndReason — Why the server ended the session.
      StreamingState — Whether the agent's video is currently playing.
      ToolCallEvent — The tool-call events delivered to onToolEvent.
      StreamOptions — Transport settings applied when the stream is created.
      CompatibilityMode — Which video codec the stream should negotiate.
      StreamType — How the agent's idle and talking video are delivered.
      AudioStreamScript — A script that makes the agent lip-sync an audio file you host, with no text-to-speech involved.
      SpeakResponse — What speak() resolves with: the video the agent is about to stream.
      TextStreamScript — A script that makes the agent say text you supply, synthesized by a text-to-speech provider.
      SpeakScript — The script payload speak() accepts: text or audio.
      parseMessageParts — Splits a message's text into the typed parts a UI can render.
      ChatResponse — What the Agents API answers a chat request with.
      InterruptOptions — What caused the user to interrupt the agent, passed to interrupt().
      Message — One message of a chat: what the user asked, or what the agent answered.
      MessageSentiment — The sentiment an agent answer was delivered with, as the server reported it.
      Rating — A rating stored against one message of a chat, as the Agents API returns it.
      RetrievalMetadata — One knowledge citation: the passage of the agent's knowledge base an answer was drawn from.
      SubmitFeedbackResponse — What the Agents API stored when end-of-call feedback was submitted.
      MessagePart — One renderable piece of a message: a run of text, an image, a video or a link.
      ChatMode — How the agent answers: with a streamed video, as text only, or not at all.
      AmazonTtsProvider — Amazon provider details: the provider type and the requested voice id.
      AzureOpenAiTtsProvider — Azure OpenAI provider details: the provider type, the requested voice id and an optional voice_config for style, rate and pitch.
      ElevenlabsTtsProvider — ElevenLabs provider details: the provider type and the requested voice id. Available to premium users.
      MicrosoftTtsProvider — Microsoft Azure provider details: the provider type, the requested voice id and an optional voice_config for style, rate and pitch.
      Voice — One voice in D-ID's catalog of text-to-speech voices.
      VoiceConfigElevenlabs — How closely an ElevenLabs voice should follow the original it was built from.
      VoiceConfigMicrosoft — How a Microsoft Azure or Azure OpenAI voice should deliver the text.
      TtsProvider — The provider object a speak script accepts: any of the four text-to-speech providers.
      Providers — The text-to-speech engines a voice can be served by.
      VoiceAccess — Who may use a voice.
      isDIDError — Type guard that reports whether a caught value is an error raised by the SDK.
      BaseError — Base class of every error the SDK itself raises.
      ChatCreationFailed — A chat could not be created for the session.
      ChatModeDowngraded — The server put the session into a different chat mode from the one that was requested, and the new mode cannot stream video.
      HttpError — A request to the Agents API came back with a non-2xx status.
      NetworkError — A request to the Agents API never reached the server, so no response came back.
      StreamError — Something went wrong inside the live audio and video stream.
      ValidationError — A method was called with arguments, or in a state, that the SDK will not send to the Agents API.
      WsError — The web socket the SDK uses for chat notifications failed to connect.
      ErrorJson — The JSON-safe payload toJson() produces, for logs and error reports.
      DIDError — Every error the SDK raises, as a union — what isDIDError narrows a caught value to.