AvaClone

Embed widget

One script tag. It renders the avatar, handles the microphone, typed questions, captions, the AI badge and the camera, and starts a session only when the visitor begins.

The script tag

<script src="https://cdn.avaclone.ai/v1/widget.js"
        data-agent="pub_…"
        data-mode="launcher"
        data-position="bottom-right"
        data-theme="auto"
        data-accent="#0052FF"
        data-label="Talk to us"
        async></script>
FieldTypeMeaning
data-agentrequiredThe publishable id from the agent's Embed tab. Public by design: it only works on the domains you listed.
data-modelauncher | inlinelauncher (default): a round avatar button in a corner that opens a panel. inline: the avatar fills the element named by data-target.
data-targetCSS selectorWhere to render in inline mode, e.g. #avatar. Give the element a size; the widget fills it.
data-positionbottom-right | bottom-leftCorner for the launcher and its panel.
data-themeauto | light | darkPanel colours. auto follows the visitor's system setting.
data-accentcolourButtons and the launcher ring. Any CSS colour.
data-labeltextThe small label under the launcher.
data-apiURLOnly for self-hosted or staging deployments; defaults to https://app.avaclone.ai/api/v1.

What the visitor sees

  • The avatar’s idle loop plays at once (no minutes used) with the AI avatar badge.
  • Pressing the microphone or typing a question starts the session. The avatar greets, listens, answers aloud with live lip-sync, and shows captions.
  • A visitor can interrupt by speaking; the avatar stops and listens.
  • Silence for the agent’s quiet cut-off ends the session; the idle loop returns. Another question starts a new one.
  • Out of minutes or over the live cap, the panel says so politely instead of failing.

The camera

When the agent has vision on, the panel shows a camera button. With the camera on, a small preview tile appears and a notice says nothing is recorded. The widget keeps only the last three seconds of frames in memory. When the visitor refers to something in view (“what is this?”, “read the label”), the agent asks for one still, picks the sharpest recent frame, and answers about it. The agent never describes or identifies people. At most ten stills a minute.

Hosted page and iframe

Every published agent has a page at https://app.avaclone.ai/a/<publishable id>: the avatar, full height, nothing else. Link to it from a QR code or a kiosk, or frame it:

<iframe src="https://app.avaclone.ai/a/pub_…"
        allow="microphone; camera; autoplay"
        style="width:380px;height:620px;border:0;border-radius:24px"></iframe>

The allow attribute matters: without it the browser blocks the microphone inside the frame.

Domains

The widget calls POST /api/v1/sessions/from-embed with the publishable id. The server checks the page’s origin against the embed’s allowed domains and only then issues a session. New embeds start with localhost listed for development. Add every host you use, including www and staging, in the agent’s Embed tab. If a publishable id leaks, rotate it there; the old one stops at once.

Content Security Policy

If your site sets a CSP, allow:

script-src  https://cdn.avaclone.ai
connect-src https://app.avaclone.ai wss://rt.avaclone.ai
media-src   https://app.avaclone.ai
img-src     https://app.avaclone.ai data: blob:

Appearance from the dashboard

The Embed tab sets captions on or off, the launcher label, theme and accent. They apply when the widget loads without changing the tag; a data- attribute on the tag wins over the dashboard. The “Powered by AvaClone” line shows on the trial and Starter and is removed on Pro and above.

Beyond the widget

For a fully custom UI (your own buttons, layouts, or a kiosk app) use the browser SDK with sessions created by your server through the API.