Skip to content

Docs / Walk / Iframe embed

Iframe embed

/walk-embed is a chrome-less, transparent page that renders one avatar. It ships frame-ancestors *, so you can drop it into an <iframe> on any origin and configure everything through URL query parameters.

The minimal embed

<iframe
  src="https://three.ws/walk-embed?env=studio&autoplay=true&ground=false"
  width="240" height="340"
  style="border:0;background:transparent"
  allow="accelerometer; gyroscope; xr-spatial-tracking"
  title="three.ws walking avatar"></iframe>
Live preview of the embed above?env=studio&autoplay=true&ground=false
For a floating corner avatar that mounts itself and gives you a runtime API, use the one-tag JavaScript SDK instead — it wraps this same iframe.

Query parameters

ParameterValuesDefaultDescription
avatarGLB / VRM URL, or avatar UUIDdefault avatarThe model to render. UUIDs are resolved through the avatar registry; URLs load directly.
controlsjoystick · keyboard · nonejoystickInput method. joystick shows an on-screen stick, keyboard enables WASD/arrows, none disables input.
envstudio · void · beach · sunset · night · gridstudioScene preset — sets background, fog, ground, and lighting.
autoplaytrue / 1offStart the avatar walking a slow circle so the embed is never static.
groundfalse to hideshownThe ground disc. Set false to float the avatar on the host background with only a soft shadow.
orbitfalse to disableenabledDrag-to-orbit the camera. Disable for non-interactive, autoplay-only embeds.
bgtransparent or a hex colourtransparentBackground fill. A hex value (e.g. %23101820) overrides the environment preset's clear colour.
targetOriginan origin*Restrict outbound postMessage events to a single origin.
allowOriginscomma-separated originsallow anyAllow-list of origins permitted to send inbound commands.
In a URL, # in a hex colour must be encoded as %23 — e.g. ?bg=%23101820.

Common recipes

Floating, non-interactive avatar (no ground, no orbit)

/walk-embed?autoplay=true&ground=false&orbit=false&controls=none

Interactive avatar with a joystick on a beach

/walk-embed?env=beach&controls=joystick

Your own avatar with a solid backdrop

/walk-embed?avatar=YOUR-AVATAR-UUID&bg=%230b0f1a&ground=false

Driving it live

Once mounted you can change the avatar, environment, motion, and speech at runtime by posting messages to the iframe. The full message protocol — including the events the iframe emits back to you — is documented in postMessage events.

const frame = document.querySelector('iframe');
// swap the avatar
frame.contentWindow.postMessage({ type: 'walk:setAvatar', id: 'NEW-UUID' }, '*');
// change the world
frame.contentWindow.postMessage({ type: 'walk:setEnv', env: 'night' }, '*');
// say something
frame.contentWindow.postMessage({ type: 'walk:narrate', text: 'Hello!' }, '*');