---
schema_version: "1"
id: 2d9ea841ea44cf273fa6debcb8019357a7a5a09d625d9b6b4790025b9ad8d054
title: settings
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/messaging-web/references/settingsAPI.md
canonical_url: https://developer.salesforce.com/docs/service/messaging-web/references/m4w-reference/settingsAPI.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 60896e87e7f264e7ddc48ca526dae284e5f405851d5fed0ff89bd257a27a10a1
products:
  - Enhanced Web Chat
  - Service Cloud Developer Content
---
# settings

This object contains settings available in the Enhanced Web Chat code snippet. See [Get started With APIs for Enhanced Web Chat](/docs/service/messaging-web/guide/api-overview.html).

## chatButtonPosition

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 %.

### Example

In this example, the chat button is `30px` from the bottom and `20px` from the right.

```javascript
embeddedservice_bootstrap.settings.chatButtonPosition = "30px,20px";
```

## disableInlineAutoLaunch

When using [inline mode](https://developer.salesforce.com/docs/ai/agentforce/guide/enhanced-chat-inline-mode.html), the chat automatically opens and the conversation starts. The `disableInlineAutoLaunch` property allows the user to start the chat later. This property's default value is `false`. Setting `disableInlineAutoLaunch` to `true` keeps the chat hidden. Call the launchChat API to start the conversation. See [Launch Chat in Enhanced Web Chat](https://developer.salesforce.com/docs/service/messaging-web/references/guides/launch-chat.md).

**note:** If `disableInlineAutoLaunch` is set to `true` without invoking the `launchChat` API, the chat will appear as an empty container to the end user.

### Example

```javascript
embeddedservice_bootstrap.settings.disableInlineAutoLaunch = true;
```

## enableUserInputForConversationWithBot

**note:** This behavior is handled by default in ECv2. This setting snippet is not available in ECv2 deployments.

Prevent end users from being able to send more than one message in a row before an Agentforce Service agent responds. To disable the Send Message text field after an end user sends a message and before an Agentforce Service agent responds to that message, add the enableUserInputForConversationWithBot snippet setting. If you use Enhanced Web Chat on an external website, add this snippet setting to your deployment’s code snippet. If you use Enhanced Web Chat on an Experience Cloud or Commerce Cloud site, add this snippet setting to the header markup.

Without this snippet setting, an end user can send two or more inbound messages in a row, and they are processed serially by the Agentforce Service agent. The end user receives a response to the first message, then a response to the second one.

### Example

```javascript
embeddedservice_bootstrap.settings.enableUserInputForConversationWithBot = false;
```

## hideChatButtonOnLoad

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](/docs/service/messaging-web/references/m4w-reference/utilAPI.html#launchchat).

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 Enhanced Chat](https://help.salesforce.com/s/articleView?id=service.miaw_business_hours.htm).


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](/docs/service/messaging-web/references/m4w-reference/userVerificationAPI.html#clearsession), 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](/docs/service/messaging-web/references/m4w-reference/utilAPI.html#showchatbutton), the API overrides the `hideChatButtonOnLoad` setting.

### Example

In this example, the setting hides the chat button when the page loads.

```javascript
embeddedservice_bootstrap.settings.hideChatButtonOnLoad = true;
```

## restrictSessionOnMessagingChannel

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`.

### Example

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.

```javascript
embeddedservice_bootstrap.settings.restrictSessionOnMessagingChannel = true;
```

## shouldMinimizeWindowOnNewTab

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`.

#### Example

In this example, the setting loads new tabs with the messaging conversation window minimized.

```javascript
embeddedservice_bootstrap.settings.shouldMinimizeWindowOnNewTab = true;
```

## shouldOpenLinksInSameTab

This code snippet controls whether a link, when clicked from a static text message in the Enhanced Web Chat conversation window, opens in a new browser tab or in the same browser tab where the messaging conversation takes place. This setting applies to links sent by agents, reps, bots and end-users.

If set to `true`, the link opens in the same browser tab as the messaging conversation window, replacing the page where the conversation is happening. The end user can return to the messaging conversation by clicking on the browser’s back button. If set to `false`, the link opens in a new browser tab. The default is `false`.

Enhanced Web Chat displays links in different forms. For example, in Pre-Chat Terms and Conditions, they’re displayed as links, but in Enhanced Rich Messages, they’re displayed as optional image previews along with a clickable message. This setting only applies to static text message links, which can appear in different formats, such as `http://salesforce.com`, `https://help.salesforce.com`, `www.google.com`, `hey search this in google.com`, or `go to agentforce.com now`.

### Example

In this example, links in static text messages will open in the same browser tab where the messaging conversation takes place.

```javascript
embeddedservice_bootstrap.settings.shouldOpenLinksInSameTab = true;
```

## shouldShowParticipantChgEvntInConvHist

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.

### Example

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.

```javascript
embeddedservice_bootstrap.settings.shouldShowParticipantChgEvntInConvHist = false;
```

## useHostSiteLanguage

By default, the underlying Lightning Web Runtime (LWR) site in the Enhanced Web Chat client is localized to `en-US`. As a result, base components that use `@salesforce/i18n`, Lightning types, and translated labels in custom components don't inherit the language of the host Experience Cloud site. Set `useHostSiteLanguage` to `true` to pass `embeddedservice_bootstrap.settings.language` through to the underlying LWR site so that the chat client renders in the same language as the host site.

Before you enable this setting, add each supported language to your LWR site. The runtime can't validate whether a language is configured on the site. For instructions and troubleshooting, see [Use the Host Site Language in ECv2](https://developer.salesforce.com/docs/service/messaging-web/references/guides/use-host-site-language.md).

The default is `false`.

### Example

In this example, the chat client localizes the underlying LWR site to Spanish (Spain).

```javascript
embeddedservice_bootstrap.settings.language = "es_ES";
embeddedservice_bootstrap.settings.useHostSiteLanguage = true;
```
