Channel Developers

Initialize for the SDK.

The Channel button appears, and features like the marketing pop-up are ready to use.

For more details, see boot.

JavaScript

parameter

type

description

bootOption

object

A boot option to initialize the SDK.

callback

(optional) Function

Callback function executed after boot.

If boot fails, the callback receives an error object as the first argument and null as the second argument.

If boot succeeds, the callback receives null as the first argument and a user object as the second argument.

JavaScript

Stops all SDK operations and initializes internal data.

JavaScript

Shows the messenger.

JavaScript

Hides the messenger.

JavaScript

Opens a chat.

  • If chatId is undefined, a new chat is opened. If the message argument is provided, it appears in the input field. If the workflow is active, it will be triggered.

  • If a chat corresponding to chatId exists, it is opened and the message argument is ignored. If the chat does not exist, an error page is displayed.

behavior

chatId

message

note

Open a new chat.

undefined

undefined

If the workflow is active, it will be triggered.

Open a new chat with a message.

undefined

string

If the workflow is active, it will be triggered.

The message appears in the input field after the workflow's operation.

Open a specific chat.

string

undefined

If the chat does not exist, an error page is displayed.

parameter

type

description

chatId

(optional) string

The chat ID.

message

(optional) string

The message to be inputted in the input field when a new chat opens.

JavaScript

Opens a user chat and starts the specified workflow.

  • openWorkflow can only be executed when the workflow trigger is set to "When starting a chat via Channel Talk."

  • If a corresponded workflow with the provided workflowId is exists, it will be executed. if workflowId is invalid, an error page is displayed.

  • If you don't pass workflowId, no action is taken.

JavaScript

parameter

type

description

workflowId

string

The ID of workflow to start with.An error page will be shown if such workflow does not exist.

JavaScript

Tracks an event.

  • If you track a new event that has not been created before, it will be created.

  • It may take a few minutes to a few hours for the event to be visible at the desk.

JavaScript

parameter

type

description

eventName

string

The name of the event.A maximum of 64 characters is allowed.

eventProperty

(optional)object

The property of the event.

JavaScript

Registers a callback that is invoked when the messenger is shown.

JavaScript

parameter

type

description

callback

Function

Callback function invoked when the messenger is shown.

JavaScript

Registers a callback that is invoked when the messenger is hidden.

JavaScript

parameter

type

description

callback

Function

Callback function invoked when the messenger is hidden.

JavaScript

Registers a callback that is invoked when there is a change in the count of messages that the user has not yet read.

JavaScript

parameter

type

description

callback

Function

Callback function invoked when there is a change in the count of messages that the user has not yet read.

The callback receives two arguments: unread (the total number of unread notifications, displayed as a red dot on the channel button and alert (the number of important unread notifications, displayed as a number on the channel button.

JavaScript

Registers a callback that is invoked when a chat is created.

JavaScript

parameter

type

description

callback

Function

Callback function invoked when a new chat is created.

JavaScript

Registers a callback that is invoked when there are changes to the user's profile.

JavaScript

parameter

type

description

callback

Function

Callback function invoked when the user's profile is updated.

The callback receives the updated profile object as an argument.

The profile object includes the following fields.

parameter

타입type

description

name

(optional) string | null

The name of a user.

email

(optional) string | null

The email of a user.

mobileNumber

(optional) string | null

The mobile number of a user.It follows E.164 format.

JavaScript

Registers a callback that is invoked when the user clicks a link. This includes following links.

  • Link button or Link text in marketing pop-ups

  • Link button or Link text sent by managers or a user in chat

JavaScript

parameter

type

description

callback

Function

Callback function invoked when a link is clicked.

It receives the URL of the clicked link as an argument.

Register the callback function to run when pop-ups (and bubbles) are displayed.

Pop-ups (and bubbles) are displayed as follows.

  • When a message is received from the manager

  • When user received a marketing pop-up

JavaScript

parameter

type

description

callback

Function

The callback function to be executed when the message bubble is displayed.Receives an informational data object for the pop-up as a parameter.

The pop-up information data object delivered as a factor in the callback function consists of the following fields.

property

type

description

avatarUrl

string

URL of the profile image of the message author

chatId

string

ID for the user chat corresponding to the message

message

(optional) string | null

Content of the message

name

string

Name of the message author

timestamp

number

Unix Timestamp for the time the message was sent

JavaScript

Clears all callbacks registered by following APIs.

JavaScript

Update a user’s information.

JavaScript

parameter

type

description

userObject

object

An object containing the user’s information to be updated.

callback

(optional) Function

Callback function invoked after the update.

If the update fails, the callback receives an error object as the first argument and null as the second argument.

If the update succeeds, the callback receives null as the first argument and an updated user object at the second argument.

You can set the following fields to update a user’s information.

field

type

description

language

(optional)string

Sets the user’s language.UI text changes to the specified language if language is 'ko' or 'ja'. Otherwise, UI text defaults to English.

profile

(optional)object |null

Sets the user’s profile.Passing null resets the entire profile. To reset a specific field in the profile object, pass null for that field. Empty objects are not allowed, and field names should follow Camel Case. FormobileNumber, follow e.164 format.

profileOnce

(optional) object

Sets the user’s profile with fields that have no existing values.

tags

(optional) array\|null

Sets the user’s tags. A maximum of 10 tags are allowed. Passingnullresets all tags. Empty arrays are not allowed.

unsubscribeEmail

(optional) boolean

Sets whether the user is subscribed to marketing emails. Subscription is terminated if set totrue.

unsubscribeTexting

(optional) boolean

Sets whether the user is subscribed to marketing SMS. Subscription is terminated if set totrue.

JavaScript

Adds a user’s tags.

JavaScript

parameter

type

description

tags

string[]

An array of tags to add.A maximum of 10 tags is allowed. Tags are always in lowercase.

callback

(optional) Function

Callback function invoked after adding tags. If the addition fails, the callback receives an error object as the first argument and null as the second argument. If the addition succeeds, the callback receives null as the first argument and an updated user object as the second argument.

JavaScript

Removes a user’s tags.

JavaScript

parameter

type

description

tags

string[]

An array of tags to remove.If the corresponding tag does not exist,it will be ignored.Passing null or an empty array is not allowed.

callback

(optional) Function

Callback function invoked after removing tags. If the removal fails, the callback receives an error object as the first argument and null as the second argument. If the removal succeeds, the callback receives null as the first argument and an updated user object as the second argument.

JavaScript

Set the page along with user chat profile. Page can be used instead of canonical URL.

Don’t pass null or undefined to page.

If the profile parameter contains non-serializable value (e.g. function object), such values are ignored.

JavaScript

parameter

type

description

page

string

The value of the page to set.

profile

(optional) Record<string, any>

The user chat profile value. When null is assigned to a specific field within the profile object, only the value of that field is cleared. The user chat profile value is applied when a user chat is created.

JavaScript

Resets the page and user chat profile value set by setPage.

When resetPage is used, the canonical URL will be used as the page value.

JavaScript

Show the channel button.

After boot, channel button shows without showChannelButton.

Manual execution of showChannelButton is only necessary if you have set hideChannelButtonOnBoot to true or have called hideChannelButton.

JavaScript

Hides the channel button.

JavaScript

Hides the Channel Popup on the global screen.

  • The popup remains hidden until the next boot occurs.

  • Use this method to visually hide the popup from the user's screen, without marking it as read.

JavaScript

Set the appearance of the theme.

  • 'light': Uses the light theme.

  • 'dark': Uses the dark theme.

  • 'system': Follows the system theme.

  • null: Follows the theme setting from the desk.

JavaScript

parameter

type

description

appearance

‘light’ | ‘dark’ | ‘system’ |null

The appearance setting for the theme.

JavaScript