# Aimigo digital human - complete documentation > Aimigo puts a talking 3D digital human on any web page with one script tag. The page controls it through a small JavaScript API; the digital human's functions are MCP commands with roles (Customer, User). Personal links connect a visitor to a contact row in a Google Sheet so the digital human greets them by name. # Aimigo documentation > Put a talking 3D digital human on any web page, control it with JavaScript or MCP commands, and greet your contacts by name. Aimigo is a digital human: a 3D character that speaks with lip sync, gestures and facial expressions. You put it on your web page with **one script tag**. Your page (or your AI agent) tells it what to say and what to do. This documentation is written so that a person **or an AI agent** can follow it step by step. If you are an AI agent: start with the [quickstart](https://aimigo.live/docs/quickstart.md) and keep to the exact code shown there. ## What you can do | Goal | Read | |---|---| | Show the digital human on a web page in about 10 minutes | [Quickstart](https://aimigo.live/docs/quickstart.md) | | Understand the parts and how they talk to each other | [How it works](https://aimigo.live/docs/how-it-works.md) | | Control it from your page: speak, switch character, change mode | [Embed and JavaScript API](https://aimigo.live/docs/embed.md) | | Build your own host script instead of the embed script | [Player protocol](https://aimigo.live/docs/player-protocol.md) | | Let your own AI agent operate the digital human | [MCP commands](https://aimigo.live/docs/mcp.md), [skills](https://aimigo.live/docs/skills.md) | | Decide which functions your end users may trigger | [Roles and permissions](https://aimigo.live/docs/permissions.md) | | Make it load fast and only once for many web sites | [Performance and caching](https://aimigo.live/docs/performance.md) | ## The three words you need - **Customer** — you: the company that puts Aimigo on its web pages or in its app. You decide what the digital human looks like, says and may do. - **User** — your end user: the visitor of your web page who sees and talks to the digital human. - **MCP command** — one function of the digital human with a name, for example `aimigo.character.set` or `aimigo.audio.setVolume`. Your page, the HTML UI and AI agents all use the same commands. Every command says which role may use it. ## Platforms | Platform | Status | |---|---| | Web pages (desktop browsers, Chrome/Edge/Firefox/Safari) | Available — this documentation | | Web pages on smartphones | Works with the same embed; mobile tuning follows ([mobile](https://aimigo.live/docs/mobile.md)) | | Windows app | Available (desktop app, MCP over a local HTTP port) | | Android and iOS apps | In preparation ([mobile](https://aimigo.live/docs/mobile.md)) | ## Status of this documentation Updated 20 November 2026. Parts marked **Planned** are decided but not built yet; everything else describes what the current version does. --- # Quickstart: a digital human on your page in 10 minutes > Exact steps, with a check after each one. Works on any web page you can edit: plain HTML, WordPress, Webflow, React, Vue. > [!TIP] > **For AI agents.** Do the steps in order. Copy the code exactly. After each step run the check. If a check fails, go to [troubleshooting](https://aimigo.live/docs/troubleshooting.md) and do not improvise another integration. ## What you need - A web page you can edit, served over **https** (or `http://localhost` while you test). - Nothing else: no account, no key, no build tool, no server change. The digital human runs in its own frame from the Aimigo player host. ## Step 1 — add the script tag Put this line right before `` of your page: ```html ``` That is all for the basic integration. The script creates a transparent frame in the bottom-right corner, loads the player and the character **Ben**, and never blocks clicks on your page. **Check:** reload the page. After a few seconds (first visit: longer, the player downloads once) Ben stands in the bottom-right corner on a transparent background. In the browser's developer tools, `Aimigo.version` returns a version string such as `"1.0.0"`. > [!NOTE] > Site builders: in WordPress use a "Custom HTML" block or a footer-script plugin, in Webflow *Project settings → Custom code → Footer code*, in React/Vue put the tag into `index.html` (not into a component that renders repeatedly). ## Step 2 — wait until the digital human is ready Every command must wait for `ready`. Add this script after the tag from step 1 (as a separate file if your page has a Content Security Policy without inline scripts): ```html ``` **Check:** the console shows `Aimigo ready`. If `dh.ready` rejects, the error message says why (see [troubleshooting](https://aimigo.live/docs/troubleshooting.md)). ## Step 3 — let it speak The digital human speaks audio that you provide (for example from your text-to-speech service). It moves its lips to the audio. ```js await dh.speak({ audioUrl: '/audio/welcome.mp3' }); ``` - `audioUrl` can be any MP3, WAV or OGG file the page can read: same origin as your page, or another origin that allows CORS. - Optional `wordTimestamps` improve lip sync and subtitles: `[{ word: 'Hello', startTime: 0.0, endTime: 0.42 }, …]` (seconds). **Check:** Ben speaks the file with moving lips. `await dh.speak(...)` resolves when playback was accepted. > [!WARNING] > Browsers block sound until the visitor has interacted with the page (a click or a key press). Call `speak` after a click, for example from a "Talk to Ben" button. Before the first interaction the audio may stay silent. ## Step 4 — choose character and mode (optional) ```js await dh.setCharacter('Viki'); // another character await dh.setMode('room', ''); // a 3D room instead of the transparent stage await dh.setMode('transparent'); // back to transparent ``` `await dh.call('aimigo.character.list', {})` and `await dh.call('aimigo.scene.list', {})` list the available characters and rooms. **Check:** the promise resolves; the change itself finishes a moment later and is reported as an event (`dh.on('event', e => console.log(e))` shows `name: "character"` or `"transparency"` with `success: true`). ## Step 5 — greet contacts by name (coming soon) With personal links, the digital human will greet each contact from your Google Sheet by name. This function is not available yet; the setup will be described here as soon as it is. ## Complete example ```html Aimigo test

My page

``` ## Done — what next - All attributes and functions: [Embed and JavaScript API](https://aimigo.live/docs/embed.md). - Every command the digital human understands: [command reference](https://aimigo.live/docs/mcp-reference.md). - Your page has a Content Security Policy, or runs inside a frame: [host page requirements](https://aimigo.live/docs/hosting.md). --- # How it works > The parts of the system, who talks to whom, and what runs where. ## The parts ```text Your web page (https://www.your-site.com) ├─ aimigo-embed.js one script tag; creates the frame and the JavaScript API (window.Aimigo) │ │ postMessage: { type: 'call', tool, input } ──► │ │ ◄── { type: 'started' | 'ready' | 'result' | 'event' | 'error' | 'contact' } │ ▼ └─ ``` For a transparent stage over your page, give the frame `pointer-events: none` unless visitors should be able to click the character. ### Query parameters | Parameter | Meaning | |---|---| | `origin` | origin of your page. The player sends messages only to it and accepts commands only from it. **Always set it.** Without it the player locks to the first page that talks to it. | | `channel` | value of the `source` field in every message; default `aimigo` | | `character` | character name or id loaded at start | | `mode` | `transparent` or `room`; `scene` = 3D room for `room` | | `sharedCache` | `0` keeps the download cache per embedding site (default: shared across sites where the browser allows it, see [performance](https://aimigo.live/docs/performance.md)) | | `affiliate` | personal link id (personal links); `salesSheet` = sheet key; `greeting=0` = no spoken greeting | | `debug` | `1` shows the player's status text inside the frame | ## Messages from your page to the player ```js frame.contentWindow.postMessage( { source: 'aimigo', type: 'call', id: 'c1', tool: 'aimigo.character.set', input: { characterId: 'Ben' } }, 'https://player.aimigo.live'); ``` `id` is yours; the answer carries the same `id`. `tool` is any [MCP command](https://aimigo.live/docs/mcp-reference.md) the role User may use, plus the player's own tools: | Tool | Input | Purpose | |---|---|---| | `audio.play` | `audioData` (base64), `contentType` (`audio/wav`, `audio/mpeg`), `wordTimestamps?` (JSON string of the list in [embed](https://aimigo.live/docs/embed.md#word-timestamps)) | speak with lip sync | | `ai.triggers` | `triggerCodes`, `audioFollowing`, `audioTimeoutSeconds`, `responseText` | gestures and expressions for the next audio (needs a loaded character) | | `contact.get` | – | the contact of a personal link | | `contact.update` | `interestAccordingAI`, `focus`, `aiNotes`, `generalFeedback`, `bookedMeetingDate` | store what the AI learned | WAV (16-bit PCM) works on every platform; the embed script converts any browser-decodable audio to 22.05 kHz mono WAV before sending. ## Messages from the player to your page Listen on `window` and check origin and source: ```js window.addEventListener('message', (event) => { if (event.origin !== 'https://player.aimigo.live' || event.source !== frame.contentWindow) return; const m = event.data; if (!m || m.source !== 'aimigo') return; // m.type: started | progress | ready | result | event | error | contact }); ``` | `type` | Fields | Meaning | |---|---|---| | `progress` | `progress` (0…1) | engine download and start-up | | `started` | `version`, `graphics`, `storage` (`shared`, `partitioned`, `no-handle`, `top-level`, `off`) | the engine runs | | `ready` | `version`, `graphics` | character and stage are loaded, commands are accepted | | `result` | `id`, `tool`, `success`, `data`, `error?`, `errorCode?` | answer to one `call` | | `event` | `detail` = `{ type: 'event', name, data }` | asynchronous outcome or state change (names in [embed](https://aimigo.live/docs/embed.md#events)) | | `error` | `message` | the player could not start or the initial stage failed | | `contact` | `contact` = `{ contactId, displayName, greeting, language, formal, fields }` | personal-link contact loaded | Send commands only after `ready`. Commands sent earlier are queued by the player, but a character command can be superseded by the initial stage transition. ## Rules - Mode changes and character changes start a transition and answer at once (`operation: 'started'`). Wait for the matching `event` before you rely on the result. - One transition at a time: when two arrive, the later one wins. To load the transparent stage with a character, send one `aimigo.transparency.set { enabled: true, characterId }` instead of two commands. - `ai.triggers` needs a loaded character; send it after `ready`. - There is no command to interrupt audio yet (**planned**); keep audio clips short if your page needs to react quickly. --- # Host page requirements > https, Content Security Policy, permissions policy, audio files and frames: what your page must allow. Most pages need nothing beyond the script tag. Check this page if your site sends security headers or the digital human does not appear. ## Checklist | Requirement | Why | How to check | |---|---|---| | Page served over **https** (or `http://localhost` for tests) | the download cache and the shared cache need a secure context | address bar shows a lock | | Script host allowed | the embed script is loaded from the Aimigo player host | no CSP error for `aimigo-embed.js` in the console | | Frame host allowed | the player runs in a frame | no CSP error mentioning `frame-src` | | Audio readable by the page | `speak({ audioUrl })` downloads the audio in your page | same origin, or the audio server sends `Access-Control-Allow-Origin` | | Autoplay not forbidden | the frame plays audio | no `Permissions-Policy: autoplay=()` on your page | ## Content Security Policy If your page sends a `Content-Security-Policy` header, add the Aimigo player host to three directives (keep your other sources): ```text script-src 'self' https://player.aimigo.live; frame-src 'self' https://player.aimigo.live; connect-src 'self' ; ``` - No `'unsafe-inline'` is needed: the embed script positions its frame through the DOM, not with inline styles or scripts. - If you use `default-src` only, the browser uses it for missing directives; add the player host there or add the three directives explicitly. - Your own `