Avatar Activation with WebSDK
This documentation page will guide you through the process of activating and managing avatars using the Avaturn WebSDK. You'll learn how to initialize the SDK, connect to sessions, and interact with a
1. WebSDK initalization
<!-- Include the WebSDK in your HTML --> <script src="https://cdn.avaturn.live/websdk/v1/avaturn.js"></script>// Import the WebSDK as a module in your JavaScript import Avaturn from 'avaturn-sdk';
// Initialize the SDK with the session token const avaturnHead = new Avaturn({ sessionToken: 'your_generated_session_token' });
2. Connecting to a Session
// Connect to the avatar session avaturnHead.connect() .then(() => { console.log('Connected to the avatar session successfully.'); }) .catch((error) => { console.error('Failed to connect to the avatar session:', error); });
3. Avatar Interaction
4. Disconnecting and Cleanup
Last updated