Widget customization

Learn how to customize the widget appearance and behavior to match your brand.

Widgets enable instant integration of Conversational AI into any website. For advanced customization, use our type-safe Conversational AI SDKs for complete control over styling and behavior.

Widgets currently require public agents with authentication disabled. Ensure this is disabled in the Advanced tab of your agent settings.

Embedding the widget

Add this code snippet to your website’s <body> section. Place it in your main index.html file for site-wide availability:

Widget embed code
1<elevenlabs-convai agent-id="<replace-with-your-agent-id>"></elevenlabs-convai>
2<script src="https://elevenlabs.io/convai-widget/index.js" async type="text/javascript"></script>

For enhanced security, define allowed domains in your agent’s Allowlist (located in the Security tab). This restricts access to specified hosts only.

Visual customization

Customize the widget’s appearance, text content, language selection, and more in the dashboard Widget tab.

Widget customization

Customize the widget colors and shapes to match your brand identity.

Widget appearance


Advanced implementation

For more advanced customization, you should use the type-safe Conversational AI SDKs with a Next.js, React, or Python application.

Client Tools

Client tools allow you to extend the functionality of the widget by adding event listeners. This enables the widget to perform actions such as:

  • Redirecting the user to a specific page
  • Sending an email to your support team
  • Redirecting the user to an external URL

To see examples of these tools in action, start a call with the agent in the bottom right corner of this page. The source code is available on GitHub for reference.

Creating a Client Tool

To create your first client tool, follow the client tools guide.

Client tool configuration

Example Implementation

Below is an example of how to handle the redirectToExternalURL tool triggered by the widget in your JavaScript code:

index.js
1document.addEventListener('DOMContentLoaded', () => {
2 const widget = document.querySelector('elevenlabs-convai');
3
4 if (widget) {
5 // Listen for the widget's "call" event to trigger client-side tools
6 widget.addEventListener('elevenlabs-convai:call', (event) => {
7 event.detail.config.clientTools = {
8 // Note: To use this example, the client tool called "redirectToExternalURL" (case-sensitive) must have been created with the configuration defined above.
9 redirectToExternalURL: ({ url }) => {
10 window.open(url, '_blank', 'noopener,noreferrer');
11 },
12 };
13 });
14 }
15});

Explore our type-safe SDKs for React, Next.js, and Python implementations.

Built with