Classes

Class: MoiSession

28min

/ Exports / MoiSession

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new MoiSession(state, options, context, config)

Parameters

Name

Type

state

Object

state.feedbacks

state.genericOptions

undefined | { options: { chat: string ; name: string ; type: "message" | "clearChat" }[] }

state.menu

undefined | { options: { chat: string ; name: string ; options: { key: string ; validations: string ; value: string }[] ; type: "message" | "customerSupport" }[] }

state.messages

MoiMessages

options

context

MoiContext

config

KlevuConfig

Defined in

Properties

config

config: KlevuConfig

Defined in



context

context: MoiContext

Defined in



feedbacks

feedbacks: MoiSavedFeedback[]

Defined in



genericOptions

Optional genericOptions: Object

Type declaration

Name

Type

options

{ chat: string ; name: string ; type: "message" | "clearChat" }[]

Defined in



menu

menu: undefined | { options: { chat: string ; name: string ; options: { key: string ; validations: string ; value: string }[] ; type: "message" | "customerSupport" }[] }

Defined in



messages

messages: MoiMessages

Defined in



options

options: MoiStartOptions

Defined in

Methods

addFeedback

addFeedback(messageId, thumbs, reason?): Promise<MoiResponse>

Parameters

Name

Type

messageId

string

thumbs

"up" | "down"

reason?

string

Returns

Promise<MoiResponse>

Defined in



clear

clear(): void

Returns

void

Defined in



query

query(request, target?): Promise<MoiResponse>

Parameters

Name

Type

request

Omit<MoiRequest, "context">

target?

MoiAPITarget

Returns

Promise<MoiResponse>

Defined in



save

save(): void

Returns

void

Defined in