Initialize for the SDK.
The Channel button appears, and features like the marketing pop-up are ready to use.
For more details, see boot.
parameter | type | description |
|---|---|---|
bootOption |
| A boot option to initialize the SDK. |
callback | (optional) | 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. |
Stops all SDK operations and initializes internal data.
Shows the messenger.
Hides the messenger.
Opens a chat.
If
chatIdisundefined, a new chat is opened. If themessageargument is provided, it appears in the input field. If the workflow is active, it will be triggered.If a chat corresponding to
chatIdexists, it is opened and themessageargument is ignored. If the chat does not exist, an error page is displayed.
behavior |
|
| note |
|---|---|---|---|
Open a new chat. |
|
| If the workflow is active, it will be triggered. |
Open a new chat with a message. |
|
| 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. |
|
| If the chat does not exist, an error page is displayed. |
parameter | type | description |
|---|---|---|
chatId | (optional) | The chat ID. |
message | (optional) | The message to be inputted in the input field when a new chat opens. |
Opens a user chat and starts the specified workflow.
openWorkflowcan only be executed when the workflow trigger is set to "When starting a chat via Channel Talk."If a corresponded workflow with the provided
workflowIdis exists, it will be executed. ifworkflowIdis invalid, an error page is displayed.If you don't pass
workflowId, no action is taken.
parameter | type | description |
|---|---|---|
workflowId |
| The ID of workflow to start with.An error page will be shown if such workflow does not exist. |
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.
parameter | type | description |
|---|---|---|
eventName |
| The name of the event.A maximum of 64 characters is allowed. |
eventProperty | (optional) | The property of the event. |
Registers a callback that is invoked when the messenger is shown.
parameter | type | description |
|---|---|---|
callback |
| Callback function invoked when the messenger is shown. |
Registers a callback that is invoked when the messenger is hidden.
parameter | type | description |
|---|---|---|
callback |
| Callback function invoked when the messenger is hidden. |
Registers a callback that is invoked when there is a change in the count of messages that the user has not yet read.
parameter | type | description |
|---|---|---|
callback |
| 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: |
Registers a callback that is invoked when a chat is created.
parameter | type | description |
|---|---|---|
callback |
| Callback function invoked when a new chat is created. |
Registers a callback that is invoked when there are changes to the user's profile.
parameter | type | description |
|---|---|---|
callback |
| 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 |
|---|---|---|
| (optional) | The name of a user. |
| (optional) | The email of a user. |
| (optional) | The mobile number of a user.It follows E.164 format. |
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
parameter | type | description |
|---|---|---|
callback |
| 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
parameter | type | description |
callback |
| 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 |
|
| URL of the profile image of the message author |
|
| ID for the user chat corresponding to the message |
| (optional) | Content of the message |
|
| Name of the message author |
|
| Unix Timestamp for the time the message was sent |
Clears all callbacks registered by following APIs.
Update a user’s information.
parameter | type | description |
|---|---|---|
userObject |
| An object containing the user’s information to be updated. |
callback | (optional) | Callback function invoked after the update. If the update fails, the callback receives an error object as the first argument and 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) | Sets the user’s language.UI text changes to the specified language if |
profile | (optional) | 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. For |
profileOnce | (optional) | Sets the user’s profile with fields that have no existing values. |
tags | (optional) | Sets the user’s tags. A maximum of 10 tags are allowed. Passing |
unsubscribeEmail | (optional) | Sets whether the user is subscribed to marketing emails. Subscription is terminated if set to |
unsubscribeTexting | (optional) | Sets whether the user is subscribed to marketing SMS. Subscription is terminated if set to |
Adds a user’s tags.
parameter | type | description |
|---|---|---|
tags |
| An array of tags to add.A maximum of 10 tags is allowed. Tags are always in lowercase. |
callback | (optional) | 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. |
Removes a user’s tags.
parameter | type | description |
|---|---|---|
tags |
| An array of tags to remove.If the corresponding tag does not exist,it will be ignored.Passing |
callback | (optional) | 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. |
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.
parameter | type | description |
|---|---|---|
page |
| The value of the page to set. |
profile | (optional) | 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. |
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.
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.
Hides the channel button.
Hides the Channel Popup on the global screen.
The popup remains hidden until the next
bootoccurs.Use this method to visually hide the popup from the user's screen, without marking it as read.
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.
parameter | type | description |
|---|---|---|
appearance |
| The appearance setting for the theme. |