Klleon SDK
Klleon SDK is a JavaScript SDK that integrates Klleon's real-time interactive avatars into web applications. It abstracts WebRTC connections and signaling so you can implement avatar conversations with simple API calls.
Key Features
- Install via
<script>tag, UMD bundle provided - Bidirectional text/voice communication
- Built-in Web Components or build your own UI
- Callback-based event subscriptions (status, signal, error)
- TypeScript type definitions included
Prerequisites
Before using the SDK, you need the following:
- Klleon Studio Account — Sign up at Klleon Studio
- Domain Registration — Register the domain of the website where you'll use the SDK (SDK Management menu)
- SDK Key — Obtain your
sdk_keyafter domain registration - Avatar ID — Find your
avatar_idin the Avatar List (only avatars with the ID copy option are available for SDK integration)
Contact
If you have any issues with domain registration or SDK usage, please contact partnership@klleon.io.
Quick Start
js
const SDK = window.KlleonSDK;
// Register events
SDK.onStatus((status) => console.log(status));
SDK.onSignal((data) => console.log(data.signal, data.payload));
SDK.onError((error) => console.error(error.code));
// Initialize
SDK.init({ sdk_key: 'YOUR_SDK_KEY', avatar_id: 'YOUR_AVATAR_ID' })
.then(() => SDK.sendMessage('Hello'))
.catch((e) => console.error(e.message));jsx
import { useEffect, useRef } from 'react';
function AvatarChat() {
const initialized = useRef(false);
useEffect(() => {
const SDK = window.KlleonSDK;
SDK.onStatus((status) => console.log(status));
SDK.onSignal((data) => console.log(data.signal, data.payload));
SDK.onError((error) => console.error(error.code));
SDK.init({ sdk_key: 'YOUR_SDK_KEY', avatar_id: 'YOUR_AVATAR_ID' })
.then(() => { initialized.current = true; })
.catch((e) => console.error('Initialization failed:', e.message));
return () => {
if (initialized.current) SDK.destroy();
};
}, []);
return (
<>
<avatar-container style={{ width: 400, height: 400 }} />
<button onClick={() => window.KlleonSDK.sendMessage('Hello')}>
Send
</button>
</>
);
}LLM Reference
To reference this documentation from an LLM, use the plain text versions:
/llms.txt— Summary/llms-full.txt— Full documentation