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
optionsObject

Optional

These are options that you can pass in to modify the created session. All possible options are listed below.

function(callbackResponse, error)Function

Optional

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
titleString

Required

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

brandString

Required

The brand that the conversation belongs to.

assistantString

Optional

The conversational assistant being used in the conversation.

langString

Optional

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

callbackResponse

PropertyTypeDescription
conversationIdString

Required

The conversation unique ID

createdAtString

Required

The conversation's created at timestamp

endedBoolean

Required

Whether or not the conversation is ended.

isInAssistantModeBooleanWhether or not the conversation is still in assistant mode.