KustomerCore.createConversation()

Creates a new session in Kustomer so you can start sending messages.

👍

First, initialize chat

You must initialize with KustomerCore.init() before you can execute any additional Core SDK methods

Examples

kustomerCore.createConversation(
  {
    title: 'Conversation Title',
    assistant: 'SOME_ASSISTANT_ID',
    brand: 'SOME_BRAND_ID',
    lang: 'en',
  },
  (response, error) => {
    console.log('Session was created!');
  })
);

Syntax

KustomerCore.createConversation(options, function(callbackResponse, error))
ParameterTypeDescription
optionsObjectOptional

These are options that you can pass in to modify the created session. All possible options are listed below.
function(callbackResponse, error)FunctionOptional

A callback that is run after KustomerCore.createConversation() completes.

callbackResponse is an object returned to the callback function. See the callbackResponse section below to see the properties of the object.

error is either undefined or a native JavaScript Error object.

options

PropertyTypeDescription
titleStringRequired

The title or subject line of the conversation. Limited to 256 characters.
brandStringRequired

The brand that the conversation belongs to.
assistantStringOptional

The conversational assistant being used in the conversation.
langStringOptional

The lang code that the created conversation should be set to.

callbackResponse

PropertyTypeDescription
conversationIdStringRequired

The conversation unique ID
createdAtStringRequired

The conversation's created at timestamp
endedBooleanRequired

Whether or not the conversation is ended.
isInAssistantModeBooleanWhether or not the conversation is still in assistant mode.