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
  • init
  • destroy
  1. New Javascript SDK [1.2.0]
  2. Methods

Life Cycle

init

Initializes the SDK and connects the socket and streaming services.

window.KlleonChat.init({
  sdk_key: "your sdk key",
  avatar_id: "your avatar id",
  subtitle_code: 'ko_kr',
  voice_code: 'ko_kr',
  voice_tts_speech_speed: 1.0,
  enable_microphone: true
  log_level: 'debug'
  user_key: 'your user key'
});
Parameter
Type
Required
Default Value
Description

sdk_key

string

O

-

Your SDK key.

avatar_id

string

O

-

The ID of the avatar to use.

subtitle_code

string

X

ko_kr

Adjusts the language of the avatar's speech text. ko_kr : Korean en_us : English ja_jp : Japanese id_id : Indonesian

voice_code

string

X

ko_kr

Adjusts the language of the avatar's spoken voice. ko_kr : Korean en_us : English ja_jp : Japanese id_id : Indonesian

voice_tts_speech_speed

number

X

1.0

Adjusts the avatar's speech speed. Range : (0.5 ~ 2.0)

enable_microphone

boolean

X

true

Connects without requiring browser microphone permission.

log_level

string

X

debug

Sets the logging level for the SDK. debug : Logs debug level or higher. info : Logs info level or higher. warn : Logs warning level or higher. error : Logs error level only. silent : Does not output logs.

user_key

string

X

-

The key value created through the endUser creation API is mapped. This key value includes the endUser key and an expiration timestamp.

user_key issuance

API info

request url
method
description

POST

end user generate API

Description

The end-user creation API is an API that creates an endUser using the application's apiKey. After the WAS authenticates the end-user accessing the digital human, the WAS calls the end-user creation API. The WAS specifies the expiration time in seconds, and the response includes the endUser key and an expiration timestamp.

Request

  1. Headers

The application's apiKey must be provided in the request header with the key x-api-key. The apiKey should be kept confidential to prevent exposure to service clients. For x-api-key issuance, please contact us separately at contact@klleon.io.

filed
type
required
description

x-api-key

string

O

Authentication method using the application's apiKey

  1. Request Body

field
type
required
description

duration

number

O

Expiration period (in seconds)

  1. Example

// request
curl --location 'https://saas.klleon.io/api/v1/app/end-user' \
--header 'x-api-key: d/LMMMThvOxszvfWZxdXDweXz2TsefaegggBI8=' \
--header 'Content-Type: application/json' \
--data '{
    "duration" : 120
}'

// response

{
    "data": {
        "userKey": "USER-FebxNRyFi1BSZDnXCDwa",
        "expiredAt": "2024-12-09T02:16:37.778977274"
    },
    "success": true
}

destroy

Destroys the SDK, removing all registered event listeners and disconnecting the current session.

window.KlleonChat.destroy();
PreviousMethodsNextText Chat

Last updated 2 months ago

✨
https://saas.klleon.io/api/v1/app/end-user