utilAPI

This object contains utility-related APIs.

This method hides the chat button.

By default, the chat button is always shown if no business hours are specified. If business hours are specified, the chat button is shown during business hours and hidden outside of business hours. To learn how to configure business hours, see Set Business Hours in Messaging for In-App and Web.

This command can override the default behavior.

You can't hide the chat button if the chat window is already showing. Also, this method doesn’t have session continuity; for example, after a refresh, the button returns to its initial state. If business hours are specified, this call only overrides the current visibility until the next business hours interval.

None.

This method shows the chat button.

By default, the chat button is always shown if no business hours are specified. If business hours are specified, the chat button is shown during business hours and hidden outside of business hours. To learn how to configure business hours, see Set Business Hours in Messaging for In-App and Web.

This command can override the default behavior.

This method doesn’t have session continuity; for example, after a refresh, the button returns to its initial state. Also, if business hours are specified, this call only overrides the current visibility until the next business hours interval.

None.

This method launches the web chat client. For a guide, see Launch Chat.

None.

Use the event handlers of this method to perform actions after the chat client launches.

Event handlerDescription
thenRuns actions if the web chat client launches successfully.
catchRuns actions when the web chat client launch fails.
finallyRuns actions after the chat client launches successfully or not.

This method returns a Promise object.