Class: MoiSession
/ Exports / MoiSession
• new MoiSession(state, options, context, config)
Name | Type |
---|---|
state | Object |
state.feedbacks | MoiSavedFeedback[] |
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 |
• config: KlevuConfig
• context: MoiContext
• feedbacks: MoiSavedFeedback[]
• Optional genericOptions: Object
Name | Type |
---|---|
options | { chat: string ; name: string ; type: "message" | "clearChat" }[] |
• menu: undefined | { options: { chat: string ; name: string ; options: { key: string ; validations: string ; value: string }[] ; type: "message" | "customerSupport" }[] }
• messages: MoiMessages
• options: MoiStartOptions
▸ addFeedback(messageId, thumbs, reason?): Promise<MoiResponse>
Name | Type |
---|---|
messageId | string |
thumbs | "up" | "down" |
reason? | string |
Promise<MoiResponse>
▸ clear(): void
void
▸ query(request, target?): Promise<MoiResponse>
Name | Type |
---|---|
request | Omit<MoiRequest, "context"> |
target? | MoiAPITarget |
Promise<MoiResponse>
▸ save(): void
void