Aimigo

Web pages

Player protocol (custom hosts)

Frame the player yourself and talk to it with postMessage, without aimigo-embed.js.

Use this only if the embed script does not fit, for example because your site already has its own avatar host script. The embed script implements exactly this protocol.

The frame

<iframe src="https://player.aimigo.live/player/latest/aimigo-player.html?origin=https%3A%2F%2Fwww.your-site.com&character=Ben&mode=transparent"
        title="Aimigo digital human"
        allow="autoplay; fullscreen; xr-spatial-tracking"
        allowtransparency="true"
        style="border:0;background:transparent;width:420px;height:620px"></iframe>

For a transparent stage over your page, give the frame pointer-events: none unless visitors should be able to click the character.

Query parameters

ParameterMeaning
originorigin 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.
channelvalue of the source field in every message; default aimigo
charactercharacter name or id loaded at start
modetransparent or room; scene = 3D room for room
sharedCache0 keeps the download cache per embedding site (default: shared across sites where the browser allows it, see performance)
affiliatepersonal link id (personal links); salesSheet = sheet key; greeting=0 = no spoken greeting
debug1 shows the player's status text inside the frame

Messages from your page to the player

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 the role User may use, plus the player's own tools:

ToolInputPurpose
audio.playaudioData (base64), contentType (audio/wav, audio/mpeg), wordTimestamps? (JSON string of the list in embed)speak with lip sync
ai.triggerstriggerCodes, audioFollowing, audioTimeoutSeconds, responseTextgestures and expressions for the next audio (needs a loaded character)
contact.get–the contact of a personal link
contact.updateinterestAccordingAI, focus, aiNotes, generalFeedback, bookedMeetingDatestore 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:

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
});
typeFieldsMeaning
progressprogress (0…1)engine download and start-up
startedversion, graphics, storage (shared, partitioned, no-handle, top-level, off)the engine runs
readyversion, graphicscharacter and stage are loaded, commands are accepted
resultid, tool, success, data, error?, errorCode?answer to one call
eventdetail = { type: 'event', name, data }asynchronous outcome or state change (names in embed)
errormessagethe player could not start or the initial stage failed
contactcontact = { 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.

This page as Markdown · llms.txt · All docs in one file