Namespace

Actions

Actions

Members

static SendMessage

Send message.
Properties:
Name Type Attributes Description
name "SendMessage"
payload Actions.ChatActionPayload | Actions.ChatActionSendMessageTextPayload
channelSid string <optional>
Unique identifier of the channel.
channel ChannelState <optional>
Represents a remote chat channel.
body string Content of the message.
messageAttributes any <optional>
Represents chat message attributes to set.
useSeparateInputStore boolean <optional>
If set to true, will store the message text in separate state and improves performance.
Example
Actions.invokeAction("SendMessage", { body: "some text", channelSid: "unique_channel_identifier" });

static SendTyping

Send typing indicator.
Properties:
Name Type Attributes Description
name "SendTyping"
payload Actions.ChatActionPayload
channelSid string <optional>
Unique identifier of the channel.
channel ChannelState <optional>
Represents a remote chat channel.
Example
Actions.invokeAction("SendTyping", { channelSid: "unique_channel_identifier" });

static SetInputText

Set message input text.
Properties:
Name Type Attributes Description
name "SetInputText"
payload Actions.ChatActionPayload | Actions.ChatActionInputTextPayload
channelSid string <optional>
Unique identifier of the channel.
channel ChannelState <optional>
Represents a remote chat channel.
body string Content of the message.
selectionStart number <optional>
Represents the cursor position or the selection start position in the message body.
selectionEnd number <optional>
Represents the selection end position in the message body.
useLocalState boolean <optional>
Deprecated - If set to true, it keeps the message value in the local component state.
useSeparateInputStore boolean <optional>
If set to true, will store the message text in separate state and improves performance.
Example
Actions.invokeAction("SetInputText", { body: "some text", channelSid: "unique_channel_identifier" });

Methods

static cancelTask()

Cancel task and go back to pre-engagement screen Fire and forget. User does not care if cancellation was successful

static endChat() → {Promise.<void>}

Signal that the chat has ended
Promise.<void>

static setAccessToken(accessToken) → {SetAccessToken}

Updates the accessToken in the state
Parameters:
Name Type Description
accessToken string
SetAccessToken

static setEngagementStage(engagementStage) → {SetEngagementStage}

Sets the engagement state to pre | in | post
Parameters:
Name Type Description
engagementStage EngagementStage
SetEngagementStage

static setEntryPointExpanded() → {SetEntryPointExpanded}

Sets isEntryPointExpanded
SetEntryPointExpanded

static setIdentity(identity) → {SetIdentity}

Updates the identity of the customer in the state
Parameters:
Name Type Description
identity string
SetIdentity

static setTaskSid(taskSid) → {SetTaskSid}

Sets the task sid
Parameters:
Name Type Description
taskSid string
SetTaskSid

static startEngagement()

Calls the startEngagement url We expect that any form post info has already been added to config.context The startEngagement call can return tokens and channelSids and roomSids
any

static toggleEntryPoint() → {ToggleEntryPoint}

Toggles entry point expansion by loading/unloading the chat from module
ToggleEntryPoint

Type Definitions

Actions.ChatActionPayload

ChatActionInputTextPayload

Properties:
Name Type Attributes Description
body string Content of the message.
selectionStart number <optional>
Represents the cursor position or the selection start position in the message body.
selectionEnd number <optional>
Represents the selection end position in the message body.
useLocalState boolean <optional>
Deprecated - If set to true, it keeps the message value in the local component state.
useSeparateInputStore boolean <optional>
If set to true, will store the message text in separate state and improves performance.

ChatActionPayload

Properties:
Name Type Attributes Description
channelSid string <optional>
Unique identifier of the channel.
channel ChannelState <optional>
Represents a remote chat channel.
Actions.ChatActionPayload

ChatActionSendMessageTextPayload

Properties:
Name Type Attributes Description
body string Content of the message.
messageAttributes any <optional>
Represents chat message attributes to set.
useSeparateInputStore boolean <optional>
If set to true, will store the message text in separate state and improves performance.

Events

Actions.ActionWithPayload

MinimizeChat

Minimize chat
Properties:
Name Type Description
name "MinimizeChat"
Example
Actions.invokeAction("MinimizeChat");

Actions.ActionWithPayload

RestartEngagement

Restart Engagement.
Properties:
Name Type Description
name "RestartEngagement"
Example
Actions.invokeAction("RestartEngagement");

Actions.ActionWithPayload

StartEngagement

Start Engagement.
Properties:
Name Type Description
name "StartEngagement"
payload WebChatActions.StartEngagementPayload
Example
Actions.invokeAction("StartEngagement", { formData: someFormData });

Actions.ActionWithPayload

ToggleChatVisibility

Toggle chat visibility.
Properties:
Name Type Description
name "ToggleChatVisibility"
Example
Actions.invokeAction("ToggleChatVisibility");

Actions

Members

static SendMessage

Send message.
Properties:
Name Type Attributes Description
name "SendMessage"
payload Actions.ChatActionPayload | Actions.ChatActionSendMessageTextPayload
channelSid string <optional>
Unique identifier of the channel.
channel ChannelState <optional>
Represents a remote chat channel.
body string Content of the message.
messageAttributes any <optional>
Represents chat message attributes to set.
useSeparateInputStore boolean <optional>
If set to true, will store the message text in separate state and improves performance.
Example
Actions.invokeAction("SendMessage", { body: "some text", channelSid: "unique_channel_identifier" });

static SendTyping

Send typing indicator.
Properties:
Name Type Attributes Description
name "SendTyping"
payload Actions.ChatActionPayload
channelSid string <optional>
Unique identifier of the channel.
channel ChannelState <optional>
Represents a remote chat channel.
Example
Actions.invokeAction("SendTyping", { channelSid: "unique_channel_identifier" });

static SetInputText

Set message input text.
Properties:
Name Type Attributes Description
name "SetInputText"
payload Actions.ChatActionPayload | Actions.ChatActionInputTextPayload
channelSid string <optional>
Unique identifier of the channel.
channel ChannelState <optional>
Represents a remote chat channel.
body string Content of the message.
selectionStart number <optional>
Represents the cursor position or the selection start position in the message body.
selectionEnd number <optional>
Represents the selection end position in the message body.
useLocalState boolean <optional>
Deprecated - If set to true, it keeps the message value in the local component state.
useSeparateInputStore boolean <optional>
If set to true, will store the message text in separate state and improves performance.
Example
Actions.invokeAction("SetInputText", { body: "some text", channelSid: "unique_channel_identifier" });

Methods

static cancelTask()

Cancel task and go back to pre-engagement screen Fire and forget. User does not care if cancellation was successful

static endChat() → {Promise.<void>}

Signal that the chat has ended
Promise.<void>

static setAccessToken(accessToken) → {SetAccessToken}

Updates the accessToken in the state
Parameters:
Name Type Description
accessToken string
SetAccessToken

static setEngagementStage(engagementStage) → {SetEngagementStage}

Sets the engagement state to pre | in | post
Parameters:
Name Type Description
engagementStage EngagementStage
SetEngagementStage

static setEntryPointExpanded() → {SetEntryPointExpanded}

Sets isEntryPointExpanded
SetEntryPointExpanded

static setIdentity(identity) → {SetIdentity}

Updates the identity of the customer in the state
Parameters:
Name Type Description
identity string
SetIdentity

static setTaskSid(taskSid) → {SetTaskSid}

Sets the task sid
Parameters:
Name Type Description
taskSid string
SetTaskSid

static startEngagement()

Calls the startEngagement url We expect that any form post info has already been added to config.context The startEngagement call can return tokens and channelSids and roomSids
any

static toggleEntryPoint() → {ToggleEntryPoint}

Toggles entry point expansion by loading/unloading the chat from module
ToggleEntryPoint

Type Definitions

Actions.ChatActionPayload

ChatActionInputTextPayload

Properties:
Name Type Attributes Description
body string Content of the message.
selectionStart number <optional>
Represents the cursor position or the selection start position in the message body.
selectionEnd number <optional>
Represents the selection end position in the message body.
useLocalState boolean <optional>
Deprecated - If set to true, it keeps the message value in the local component state.
useSeparateInputStore boolean <optional>
If set to true, will store the message text in separate state and improves performance.

ChatActionPayload

Properties:
Name Type Attributes Description
channelSid string <optional>
Unique identifier of the channel.
channel ChannelState <optional>
Represents a remote chat channel.
Actions.ChatActionPayload

ChatActionSendMessageTextPayload

Properties:
Name Type Attributes Description
body string Content of the message.
messageAttributes any <optional>
Represents chat message attributes to set.
useSeparateInputStore boolean <optional>
If set to true, will store the message text in separate state and improves performance.

Events

Actions.ActionWithPayload

MinimizeChat

Minimize chat
Properties:
Name Type Description
name "MinimizeChat"
Example
Actions.invokeAction("MinimizeChat");

Actions.ActionWithPayload

RestartEngagement

Restart Engagement.
Properties:
Name Type Description
name "RestartEngagement"
Example
Actions.invokeAction("RestartEngagement");

Actions.ActionWithPayload

StartEngagement

Start Engagement.
Properties:
Name Type Description
name "StartEngagement"
payload WebChatActions.StartEngagementPayload
Example
Actions.invokeAction("StartEngagement", { formData: someFormData });

Actions.ActionWithPayload

ToggleChatVisibility

Toggle chat visibility.
Properties:
Name Type Description
name "ToggleChatVisibility"
Example
Actions.invokeAction("ToggleChatVisibility");