KustomerCore.init()
Initializes chat by fetching your chat settings and business schedules.
First, initialize chat
You must initialize with
KustomerCore.init()
before you can execute any additional Core SDK methods
Examples
// Initialize chat
KustomerCore.init();
// Initialize chat with options and then fetch conversations
KustomerCore.init({
brandId: 'SOME_BRAND_ID',
scheduleId: 'SOME_SCHEDULE_ID'
}, function (chatSettings) {
console.log(chatSettings);
KustomerCore.getConversations();
});
Syntax
KustomerCore.init(options, function(callbackResponse, error))
Parameter | Type | Description |
---|---|---|
options | Object | Optional These are options that you can pass in to modify how your chat initializes. All possible options are listed below. |
function(callbackResponse, error) | Function | Optional A callback that is run after callbackResponse is an object returned to the callback function. See the error is either |
options
options
Property | Type | Description |
---|---|---|
brandId | string | Optional By passing in a |
scheduleId | String | Optional By passing in a |
assistantId | String | Optional By passing in an |
callbackResponse
callbackResponse
Property | Type | Description |
---|---|---|
settings | Object | Required This is your Kustomer instance's chat settings, containing properties like your |
settings
{
activeAssistant: "SOME_ASSISTANT_ID",
brandId: "SOME_BRAND_ID",
closableChat: true,
colors: {},
embedIconColor: "#6e89a0",
embedIconUrl: "SOME_ICON_URL",
teamIconUrl: "SOME_URL",
teamName: "Gap",
greeting: "Greetings!",
knowledgeBaseId: "SOME_KB_ID",
noHistory: false,
offhoursImageUrl: "SOME_URL",
offhoursMessage: "SOME_URL",
showBrandingIdentifier: true,
singleSessionChat: false,
volumeControl: {
enabled: true,
followUpChannels: [],
hideWaitOption: false,
markDoneAfterTimeout: true,
mode: "upfront",
promptDelay: 60,
timeout: 300,
upfrontWaitThreshold: 60,
useDynamicWaitMessage: false
},
waitMessage: "Wait Message",
widgetType: "chat-kb",
}
Updated 7 months ago