Step by step guide to embedding, customizing, and animating interactive 3D WebGL and 2.5D avatars using the Asiyst Web SDK, CLI, and Script Tag. Overview &...
On this page (17 sections)
Overview & Architecture
The Asiyst Web SDK features an embedded client-side 3D WebGL and Canvas avatar engine engineered specifically for websites. Rather than rendering traditional video streams that consume significant server bandwidth and suffer high round-trip latency, Asiyst renders character models client-side inside an isolated Shadow DOM container.
This client-rendered architecture delivers several foundational benefits for modern websites:
Ultra-low latency: Gestures, facial visemes, and speech balloons react instantly under 60 milliseconds to customer input.
Microscopic footprint: The initial client script weighs under 28 KB gzipped. 3D meshes, textures, and animation sequences stream asynchronously in progressive LOD (Level of Detail) chunks only after primary page interactive events complete.
Zero render-blocking impact: The avatar engine mounts outside the critical rendering path, ensuring zero degradation to your Google Lighthouse Core Web Vitals (Largest Contentful Paint, Interaction to Next Paint, and Cumulative Layout Shift).
---
Installation & Embedding Methods
You can integrate the interactive visual avatar onto any webpage or Single Page Application (React, Next.js, Vue, Nuxt, Svelte, Angular, or standard HTML) using three primary methods.
Method 1: Modern NPM Package (@asiyst/sdk)
For TypeScript and modern JavaScript applications, install the official package:
npm install @asiyst/sdk
Initialize the client with your public Project Key inside a browser-only lifecycle boundary:
import { Asiyst } from "@asiyst/sdk";
// Initialize on client mount (e.g., useEffect in React or onMounted in Vue)
const assistant = Asiyst.init({
projectKey: process.env.NEXT_PUBLIC_ASIYST_PROJECT_KEY!,
avatar: {
enabled: true,
mode: "floating", // "floating" or "docked"
position: "bottom-right",
theme: "light",
initialState: "greeting",
},
assistant: {
welcomeMessage: "Hi there! How can I help you navigate our catalog today?",
},
});
Method 2: Asynchronous Script Tag (CDN)
For WordPress, Shopify, Webflow, Squarespace, or static HTML pages, paste the asynchronous loader tag immediately before your closing
If you use the Asiyst Developer CLI, you can verify your domain connection and scaffold avatar configuration directly from your terminal:
# Authenticate CLI
asiyst login
# Inspect and link your project
asiyst projects link
# Validate WebGL canvas runtime and avatar asset connectivity
asiyst avatar test --url https://yourwebsite.com
---
Display Modes: Floating vs Docked
Asiyst supports two primary layout modes to fit your user experience design.
1. Floating Mode (Default)
In floating mode, the avatar hovers in a fixed corner of the visitor's viewport (e.g., bottom-right or bottom-left). When minimized, the avatar displays subtle breathing animations; when clicked or when contextual page events fire, it expands to provide conversational assistance.
The assistant avatar dynamically synchronizes its facial expressions and skeletal gestures with conversation context, response sentiment, and user interactions:
// Trigger specific emotional states programmatically
Asiyst.setAvatarState("greeting"); // Welcomes the user with a friendly hand wave
Asiyst.setAvatarState("thinking"); // Natural head tilt while AI generates response
Asiyst.setAvatarState("explaining"); // Expressive hand gestures during explanation
Asiyst.setAvatarState("celebrating"); // Confetti & positive gesture upon checkout completion
Asiyst.setAvatarState("idle"); // Subtle breathing & blinking eye movements
Available procedural animation states:
greeting: Hand wave gesture with warm eye contact.
idle: Procedural breathing, head sway, and realistic eye blinking.
listening: Attentive posture with slight forward lean when user is typing.
thinking: Contemplative eye gaze and micro-gestures while streaming AI tokens.
explaining: Natural hand and arm cadence synchronized with speech cadence.
pointing: Targets and highlights specific CSS selectors on the host website.
celebrating: Joyful gesture designed for conversion goals and milestones.
---
Speech Synthesis & Lip-Sync
Asiyst features real-time audio synthesis with procedural viseme lip-synchronization. The engine maps phonemes to 15 standard blendshape targets on the 3D face mesh (jaw open, lip funneler, mouth smile, etc.).
// Broadcast speech bubble and synchronized mouth visemes
await Asiyst.say({
text: "Welcome to our store! Check out our new holiday collection.",
audio: true, // Enables natural text-to-speech audio playback
highlightSelector: "#holiday-collection-banner",
});
---
Custom 3D Model Pipeline (glTF / GLB)
Organizations on Vector and Quantum plans can upload and deploy custom 3D brand mascots and avatars through the Asiyst Avatar Studio:
Rigging Standard: Humanoid or stylized character rigged with 52 standard ARKit blendshapes or humanoid bone hierarchy (hips, spine, neck, head, eyes).
File Format: Binary glTF (.glb) export.
Draco Compression: Recommended polygon count between 15,000 and 45,000 triangles, compressed with Google Draco mesh compression.
Texture Maps: 1024x1024 or 2048x2048 PBR maps (Albedo, Normal, Roughness, Metalness) encoded in KTX2 or WebP format for rapid GPU texture uploads.
# Deploy custom 3D model via CLI
asiyst avatar upload ./assets/custom-mascot.glb --project prj_live_9a8f2c3d4e5f
---
Core Web Vitals & Zero Render-Blocking
Asiyst is engineered strictly according to Google Lighthouse Core Web Vitals performance benchmarks:
Largest Contentful Paint (LCP): The 3D canvas is mounted asynchronously in a secondary thread, ensuring your primary images, hero headers, and typography render without interruption.
Interaction to Next Paint (INP): All WebGL animation ticks run inside requestAnimationFrame decoupled from the browser main thread, preventing frame drops during clicks, taps, or keystrokes.
Cumulative Layout Shift (CLS): The floating container uses fixed dimension placeholders, preventing layout jumps or DOM element displacement.
---
Troubleshooting & Diagnostics
Symptom
Probable Cause
Recommended Resolution
Avatar displays blank canvas
WebGL 2.0 disabled or GPU hardware acceleration off
Verify canvas.getContext('webgl2') support; SDK automatically falls back to lightweight 2.5D visual sprite
Custom avatar model fails to load
Missing CORS headers on external 3D asset URL
Serve .glb assets with Access-Control-Allow-Origin: * or upload directly to Asiyst CDN
Mouth movement out of sync with audio
Audio format bitrate mismatch
Use standard 24kHz or 48kHz mono PCM MP3 stream output
Container clipped on mobile devices
Viewport meta tag missing viewport-fit=cover
Configure responsive floating offsets or switch to docked layout on screen widths < 768px
---
Frequently Asked Questions
Does the interactive avatar require high-end GPU hardware?
No. The Asiyst rendering pipeline automatically detects device capabilities. On mobile devices or low-powered laptops, the engine scales canvas resolution, disables post-processing bloom, and caps frame rate at 30 FPS to ensure seamless performance without battery drain.
Can I run the avatar in text-only mode without voice audio?
Yes. You can disable voice synthesis in your dashboard settings or initialize with audio: false. In this mode, the avatar communicates through animated speech bubbles with expressive gestures.
How does the avatar navigate visitors around my website?
Using DOM guidance actions, the avatar can point to specific buttons, highlight promotional banners, or open navigation drawers using CSS selector targeting (Asiyst.guideTo('#pricing-table')).