Interface

Actions

Actions

Members

# static MinimizeChat

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

# static RestartEngagement

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

# 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" });

# static StartEngagement

Start Engagement.
Properties:
Name Type Description
name "StartEngagement"
payload Actions.StartEngagementPayload
formData Object Represents pre engagement form data. This object will be available in `channel.attributes.pre_engagement_data`.
Example
Actions.invokeAction("StartEngagement", { formData: someFormData });

# static ToggleChatVisibility

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

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.

# StartEngagementPayload

Properties:
Name Type Description
formData Object Represents pre engagement form data. This object will be available in `channel.attributes.pre_engagement_data`.