Klleon Chat SDK
English
English
  • ✨New Javascript SDK [1.2.0]
    • Getting Started
    • Events
    • UI
    • Methods
      • Life Cycle
      • Text Chat
      • Voice Chat
      • Echo Chat
      • Audio Echo Chat
      • Other
    • TypeScript Support
    • Examples
      • VanillaJS
      • React
      • Nextjs
    • Log System
    • Updates
  • JavaScript SDK [v0.x.x] (Planned for Deprecation)
    • Quick Start
    • Initialize
    • Avatar Streaming
      • Start Streaming
      • Stop Streaming
      • Control Streaming Screen
    • Set Chat Screen
    • Text Message
    • Voice Message
    • Echo - Repeat My Message
    • Event Subscription
    • Updates
  • Service Architecture
Powered by GitBook
LogoLogo

Products

  • Pricing

Websites

  • Homepage
  • Youtube
  • Linkedin

Copyright © Klleon. All rights reserved

On this page
  • SDK Summary
  • 1. Platform
  • 2. SDK Installation
  • 3. SDK Initialization
  • 4. Key Features
  • 5. Examples
  • 6. TypeScript Support
  • 7. Logging System

New Javascript SDK [1.2.0]

NextGetting Started

Last updated 3 months ago

SDK Summary

1. Platform

Register your site's domain to call the Klleon API.

Domain registration is available in the SDK Management section of .

If any issues arise, please contact partnership@klleon.io


2. SDK Installation

Include the JavaScript SDK file in your web page.

Specify the SDK version in the script tag.

<script src="https://web.sdk.klleon.io/1.0.0/klleon-chat.umd.js"></script>

3. SDK Initialization

Initialize the SDK using the init() method.

Required options:

  • sdk_key

  • avatar_id

window.KlleonChat.init({
  sdk_key: "your sdk key",
  avatar_id: "your avatar id",
});

4. Key Features

Event Handlers

  1. onChatEvent: Handles chat events.

  2. onStatusEvent: Manages status events.

UI Components

  1. <avatar-container />: Renders avatar streaming as a Web Component.

  2. <chat-container />: Renders the chat interface as a Web Component.

Lifecycle Methods

  1. init: Initializes the SDK, connecting sockets and streaming.

  2. destroy: Ends the SDK session and cleans up resources.

Chat Methods

  1. sendTextMessage: Sends a text message.

  2. echo: Implements a message echo function. Repeats the exact input text as speech.

  3. startStt / endStt: Records and sends voice messages.

Additional Methods

  1. changeAvatar: Changes the avatar.

  2. clearMessageList: Clears the message list.

  3. stopSpeech: Stops the avatar's speech.


5. Examples


6. TypeScript Support


7. Logging System

Use for SDK type definitions and apply them to tsconfig.json.

✨
Klleon Studio
VanillaJS
React
NextJS
KlleonSdk.d.ts
Log list
Log types
Log levels