This object contains settings available in the Messaging for Web code snippet. See Get Started With APIs for Messaging for Web.

Change the minimized chat button position to prevent it from overlapping with other features on your webpage. The default position is the bottom-right corner of the webpage at "25px,30px". When the web chat client is maximized, the client hides the chat button.

Specify the bottom-right coordinates of the minimized chat position in CSS length units, such as px, em, rem, or %.

In this example, the chat button is 30px from the bottom and 20px from the right.

This property shows or hides the Salesforce chat button at load time. If you hide the chat button, you can still launch a messaging session with launchChat API.

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 code snippet setting overrides the Salesforce settings. So, if you want the chat button to appear during business hours, for example, on sales pages, leave out this setting on those pages. If you configured business hours but want the chat button to show outside of business hours, for example, on contact pages because you configured a bot with the messaging channel, add this setting and set it to false.

After the session ends by closing the messaging conversation window or calling clearSession API, the chat button returns to the same initial state as when the page loads. But if you minimize the window with an active session, the button always appears so that the user can continue the session.

If you use showChatButton API, the API overrides the hideChatButtonOnLoad setting.

In this example, the setting hides the chat button when the page loads.

If set to true, this setting clears an active messaging session when the user navigates to a page configured with a Messaging channel that's different from the one used to initialize the session. After the session clears, the client retrieves the user’s conversation history for the current channel only. If this setting is set to false, the session isn’t cleared after the client switches Messaging channels and the client fetches the user’s conversation history across all channels.

For example, let’s say that you have two Messaging channels, one for unverified users and one for verified users. In this case, when a user starts a conversation as an unverified user and then becomes verified by logging in, the Messaging channel changes. If this setting is set to true, the session clears and the Messaging conversation window closes after the user becomes verified. When the user clicks the chat button again, the client retrieves the history of the user-verified channel. If you configured automated responses for both channels, after the client clears the previous session, the session starts with the automated response of the current channel.

The default is false.

In this example, the web chat client clears the session and retrieves the user's conversation history for the new messaging channel when the channel changes.

When this code snippet setting is set to false, the default, if you open a new tab from your current tab with an active Messaging session, the web chat client in the new tab loads with the messaging conversation window maximized. The active session continues with the window open in the new tab.

However, if you prefer to load new tabs with the window minimized, even when the session is active on the previous tab, set this code snippet setting to true. For example, you can set the web chat client to open on help or contact pages for immediate support but minimize it on product pages to avoid distractions.

The default is false.

In this example, the setting loads new tabs with the messaging conversation window minimized.

For a simpler read through, use the code snippet setting to control whether the conversation history shows when an agent or bot joins or leaves the session. This setting affects the output in the messaging conversation window but not the transcript.

The default is true. The agent- or bot-changed events are shown in the messaging conversation window.

In this example, the web chat client hides the events of when an agent or bot joins or leaves the session from the conversation history.