Embedding Avatars
Add an Avatarium avatar to any website or application. No SDK installation required.
Script Tag (Recommended)
The easiest way – no build step required:
<script src="https://avatarium.ai/widget.js"></script>
<div id="avatarium-widget" data-avatar-id="YOUR_SHORT_ID" style="width: 400px; height: 600px;"></div>The widget handles everything: loading the 3D avatar, voice chat UI, and responsive sizing.
Widget Options
| Attribute | Description | Default |
|---|---|---|
data-avatar-id | Your avatar's short ID (required) | – |
data-width | Widget width | 100% |
data-height | Widget height | 600px |
iframe Embed
For more control over isolation and styling:
<iframe
src="https://avatarium.ai/a/YOUR_SHORT_ID/voice"
style="width: 400px; height: 600px; border: none; border-radius: 16px;"
allow="microphone; camera"
></iframe>⚠️
The allow="microphone" attribute is required for voice chat to work.
Responsive iframe
<div style="position: relative; width: 100%; max-width: 400px; aspect-ratio: 9/16;">
<iframe
src="https://avatarium.ai/a/YOUR_SHORT_ID/voice"
style="position: absolute; inset: 0; width: 100%; height: 100%; border: none; border-radius: 16px;"
allow="microphone; camera"
></iframe>
</div>Framework Examples
export function AvatarWidget({ avatarId }: { avatarId: string }) {
return (
<iframe
src={`https://avatarium.ai/a/${avatarId}/voice`}
className="w-full h-[600px] border-0 rounded-2xl"
allow="microphone; camera"
/>
);
}Mobile Apps (WebView)
For native mobile apps, load the avatar URL in a WebView:
| Platform | Component |
|---|---|
| iOS (Swift) | WKWebView – grant microphone permission |
| Android | WebView – enable JavaScript + MediaStream |
| Flutter | webview_flutter or flutter_inappwebview |
| React Native | react-native-webview |
URL: https://avatarium.ai/a/YOUR_SHORT_ID/voice💡
Ensure your WebView grants microphone access for voice chat to work.
Desktop Apps
For Electron, Tauri, or native desktop apps:
- Tauri – Uses native WebView (WKWebView on macOS, WebView2 on Windows)
- Electron – Standard
<webview>orBrowserWindow
Load the same URL: https://avatarium.ai/a/YOUR_SHORT_ID/voice
Finding Your Avatar ID
- Go to Dashboard (opens in a new tab)
- Click on your avatar
- The Short ID is shown in avatar details (e.g.,
abc123)
Customization
All avatar customization (voice, personality, appearance) is managed in the dashboard. Changes apply instantly to all embedded instances – no code updates needed.
Next Steps
- Quick Start – Create your first avatar
- Voice Configuration – Choose the right voice
- SDK Examples (opens in a new tab) – Code examples for all frameworks