Overview

Configuration options and display modes for the embed

Configure the embed script with data attributes. No JavaScript required for basic setup.

Display modes

Floating button (fabio)

A floating button opens the agent in an overlay. Best for adding an agent to any page without affecting layout.

Inline

Embed the agent directly in your page. Best for dedicated agent pages or custom layouts.

Full mode

Render the agent in a target element. Requires data-target-id and a DOM element.

Required attributes

AttributeTypeDescription
data-client-keystringClient key from Create Client Key API
data-agent-idstringAgent ID from Create Agent

Optional attributes

AttributeTypeDefaultDescription
data-modestringfabioDisplay mode: fabio, inline, or full
data-namestringdid-agentCustom name for the script element (for multiple agents)
data-positionstringrightPosition: right or left
data-orientationstringverticalLayout: horizontal or vertical
data-open-modestringcompactInitial state: compact or expanded
data-monitorstringtrueEnable analytics: true or false
data-trackstringtrueEnable tracking: true or false
data-auto-connectstringfalseConnect automatically on load: true or false
data-show-restart-buttonstringtrueShow restart button: true or false
data-target-idstring-Target element ID for full mode

Basic examples

Floating button (default)

<script
  type="module"
  src="https://agent.d-id.com/v2/index.js"
  data-mode="fabio"
  data-client-key="{client_key}"
  data-agent-id="{agent_id}"
  data-position="right"
></script>

Inline mode

<script
  type="module"
  src="https://agent.d-id.com/v2/index.js"
  data-mode="inline"
  data-client-key="{client_key}"
  data-agent-id="{agent_id}"
></script>

Full mode (target element)

<div id="agent-container"></div>

<script
  type="module"
  src="https://agent.d-id.com/v2/index.js"
  data-mode="full"
  data-target-id="agent-container"
  data-client-key="{client_key}"
  data-agent-id="{agent_id}"
></script>

When to use

Use the embed when:

  • You want the quickest integration (minutes)
  • You're adding an agent to a content or marketing site
  • You prefer no-code or minimal-code solutions

Need more control? See Advanced option for the programmatic API, or the D-ID Agents SDK for custom UI.

Browser support

Chrome, Firefox, Safari, Edge (latest 2 versions), and mobile browsers. Requires WebRTC.

Troubleshooting

Agent not appearing?

  1. Verify data-client-key and data-agent-id are correct
  2. Ensure your domain is in the client key's allowed_domains (use Update Client Key API)
  3. Check the browser console for errors
  4. Confirm https://agent.d-id.com/v2/index.js loads

Custom styling:

did-agent {
  /* Your custom styles */
}

FAQ

Create an agent in D-ID Studio, then use the Embed menu to copy the script tag with credentials. Or use the Create Agent and Create Client Key APIs.

Yes. Use different data-name values for each script (e.g. did-agent, did-agent-2) and ensure each has a unique client key and agent ID.

Yes. The embed works with all D-ID agent versions and configurations.

Next steps

Support

Have any questions? We're here to help! Go to the Help Center or send us a message.

Contact Support