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
  • onChatEvent
  • onStatusEvent
  1. New Javascript SDK [1.2.0]

Events

onChatEvent

Subscribe to SDK cjat events.

KlleonChat.onChatEvent((data: ChatData) => {
  console.log(data, "chat data");
});
{"message":"","chat_type":"PREPARING_RESPONSE","time":"2024-04-05T06:40:27.523350758"}
{"message":"Good to see you!","chat_type":"TEXT","time":"2024-04-05T06:38:02.549614802"}
{"message":"","chat_type":"RESPONSE_IS_ENDED","time":"2024-04-05T06:40:37.08653676"}
...
Data
Type
Description

message

string

The message received from the streaming server.

chat_type

string

Type of the message.

time

string

The time the message was received.

id

string

Unique message UUID

chat_type
Description

TEXT

Avatar message. Starts streaming the video with lip-sync transformation.

STT_RESULT

User's voice message.

RATE_LIMIT

Avatar message reception is disabled due to rate limiting.

WAIT

Waiting to start the chat.

WARN_SUSPENDED

Warning : Chat will stop in 10 seconds if there is no user interaction.

DISABLED_TIME_OUT

Chat stops after a period of user inactivity.

TEXT_ERROR

User message failed to send.

TEXT_MODERATION

User input contains inappropriate language.

ERROR

Server error occurred.

RESPONSE_IS_ENDED

Avatar's message transmission has ended.

WORKER_DISCONNECTED

Streaming has ended.

ACTIVATE_VOICE

Starts voice recognition.

PREPARING_RESPONSE

Avatar is preparing a response.

EXCEED_CONCURRENT_QUOTA

Maximum concurrent user limit exceeded.


onStatusEvent

Check the SDK connection status through events.

KlleonChat.onStatusEvent((data: Status) => {
  console.log(data, "chat data");
});
Data
Type
Description

status

string

Displays the current connection status of the SDK.

Order

1

IDLE

Before SDK connection.

2

CONNECTING

SDK is attempting to connect.

3

CONNECTING_FAILED

SDK connection failed.

4

SOCKET_CONNECTED

Socket connection established.

5

SOCKET_FAILED

Socket connection failed.

6

STREAMING_CONNECTED

Streaming connection established.

7

STREAMING_FAILED

Streaming connection failed.

8

CONNECTED_FINISH

Both Socket and Streaming connections are completed.

9

VIDEO_LOAD

Streaming video is loaded on the screen.

10

VIDEO_CAN_PLAY

Streaming video is ready to play on the screen.

PreviousGetting StartedNextUI

Last updated 4 months ago

✨