> For the complete documentation index, see [llms.txt](https://docs-en.dydu.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-en.dydu.ai/livechat/salesforce-livechat-connector.md).

# Salesforce Livechat connector

This documentation guides you through setting up livechat escalation to Salesforce directly from your Dydu interface (BMS). It focuses exclusively on the settings required on the Dydu side to establish the connection between your chatbot and your contact center tool.

Before proceeding with the configuration, you must enable the Salesforce connector by navigating to **Preferences > Bot**. Once activated, you will find the external connector configuration interface directly within your **Livechat Settings**.

<figure><img src="https://264031769-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPMvi3Izk7dvjl9HitZpp%2Fuploads%2Fhv9BOHwGyzaZJ7MhdiE5%2FCapture%20d%E2%80%99%C3%A9cran%20du%202026-11-10%2013-57-42.png?alt=media&amp;token=2736bcfc-ad8e-4135-8344-707725f8456f" alt=""><figcaption></figcaption></figure>

## Salesforce Connector

This first step establishes the core link between the Dydu BMS and your Salesforce environment. You must provide the following three essential pieces of information, which can be retrieved directly from your Salesforce administration interface:

* **Chat Server Address (SCRT)**: The specific URL of your Salesforce chat server required to route conversations.
* **Organization ID**: The unique identifier (ID) corresponding to your Salesforce environment.
* **Technical Configuration Name**: The developer name (or API name) of your Livechat configuration created within Salesforce.

<figure><img src="https://264031769-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPMvi3Izk7dvjl9HitZpp%2Fuploads%2FGpoZdI2ZrlbbL5JTluiD%2FCapture%20d%E2%80%99%C3%A9cran%20du%202026-07-08%2015-12-28.png?alt=media&amp;token=3b04a9a6-0c95-423b-ac9a-338c8ba3ef80" alt="" width="563"><figcaption></figcaption></figure>

## Security and Authentication

This second step secures the exchanges between the Dydu chatbot and the Salesforce servers. The authentication tokens (JWT) sent to Salesforce are signed with a private key generated by Dydu: you no longer need to provide a private key or a certificate. You will need to fill in the following fields:

* **Subject / Target User (SUB)**: The identity of the target user or system for which the token is issued. You must specify the corresponding context variable here.
* **Private key (PEM format)**: The field used to upload the private key generated by Dydu, in .PEM format. This field is filled in by the Dydu team. The **Private key already set** message is displayed when a key has already been uploaded.

<figure><img src="https://264031769-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPMvi3Izk7dvjl9HitZpp%2Fuploads%2F3t9IBfXGPxVeOrSv1ewh%2FCapture%20d%E2%80%99%C3%A9cran%20du%202026-11-10%2013-57-03.png?alt=media&amp;token=880e2ac9-23a3-4280-94ee-4a65e95c9e12" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="info" %}
The Key ID (KID) and the Token Issuer (ISS) no longer need to be filled in.
{% endhint %}

**Salesforce configuration**: for Salesforce to accept the tokens signed by Dydu, perform the following steps in your Salesforce environment:

1. Get the public key in JWK format (.json file) from Dydu.
2. Add this public key (JWK) to the user verification settings of your Messaging deployment.
3. Enter "Dydu" as the token issuer.

## Salesforce Connection Credentials

This third step configures the credentials needed for API authentication and queue management to route users to your agents. You must specify:

* **Client ID**: The identifier of your Salesforce connected application.
* **Client Secret**: The secret key associated with your Salesforce application.
* Queue Configuration:
  * **Queue Name**: The exact name of the queue to direct users to, as defined in your Salesforce environment.
  * **Maximum Queue Capacity**: The maximum number of users allowed to wait in this queue simultaneously.

<figure><img src="https://264031769-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPMvi3Izk7dvjl9HitZpp%2Fuploads%2FzbCLZehH2U2iyHoHCh5X%2FCapture%20d%E2%80%99%C3%A9cran%20du%202026-07-08%2015-16-45.png?alt=media&amp;token=68d0c1a3-dd15-487b-a8a9-9eb11b9b948d" alt="" width="563"><figcaption></figcaption></figure>

## Context Variables to Salesforce Tokens

This final step is optional but highly useful. It allows you to map context variables from the bot conversation to tokens (JWT claims) to manipulate them or pass them to Salesforce if needed.

The interface consists of an interactive table where you can add as many rows as necessary. For each new entry, configure:

* **Variable Name (JWT Claim)**: The name of the data you want to include in the token.
* **Pass to Agent (transmittorouting)**: An option to determine whether this variable should be sent to the Salesforce agent. Since these variables are often used on the Dydu side purely for statistics, you can choose to hide them from the agent during escalation.

**Variable Management**: Once a variable is added to the table, you retain full control over it and can modify or delete it at any time.

<figure><img src="https://264031769-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPMvi3Izk7dvjl9HitZpp%2Fuploads%2F3MhWQHEjqgio2uUpiy6T%2FCapture%20d%E2%80%99%C3%A9cran%20du%202026-07-08%2015-24-40.png?alt=media&amp;token=ff52b024-ae8d-49b2-a2cf-2dccff49b4f8" alt="" width="563"><figcaption></figcaption></figure>

## Checking Salesforce livechat availability

Before offering an escalation to Salesforce, you can check whether the livechat is open and whether an operator is available using [context conditions](https://docs-en.dydu.ai/contents/context-conditions). With the Salesforce connector, these checks rely directly on the information in your Salesforce environment:

* **LiveChatOpen()**: checks whether the livechat is open according to the opening hours (Business Hours) defined in Salesforce. The opening hours used are the ones with the same name as the queue entered in the **Queue Name** field. The holidays defined in Salesforce are also taken into account: the livechat is considered closed on those days.
* **LiveChatAvailable()**: only checks whether at least one Salesforce operator is connected and available. This condition does not check the opening hours.

{% hint style="info" %}
With the Dydu livechat, the **LiveChatAvailable()** condition checks both whether the livechat is open and whether an operator is available. With the Salesforce connector, it only checks operator availability: use **LiveChatOpen()** to check the opening hours.
{% endhint %}

To display a different answer depending on whether the livechat is closed or no operator is available:

1. Go to the **Contents > Context Conditions** page and create a condition using **LiveChatOpen()** and a condition using **LiveChatAvailable()**.
2. In your escalation knowledge (for example "I want to talk to an advisor"), insert the condition using **LiveChatOpen()**.
3. In the failure branch, enter the answer to display when the livechat is closed.

> Example: "Our service is currently closed. Our advisors are available Monday to Friday from 9 am to 6 pm."

4. In the success branch, insert the condition using **LiveChatAvailable()**.
5. In the failure branch of this second condition, enter the answer to display when no operator is available.

> Example: "All our advisors are currently busy, please try again in a few moments."

6. In the success branch, edit the answer, click on **More options** > **Other options** > **Set GUI action** and select **Connect Livechat**.
7. Click on **Update**.

{% hint style="warning" %}
Checking the opening hours from the external tool with **LiveChatOpen()** is only available for the Salesforce connector.
{% endhint %}

## Using the Salesforce waiting queue

With the Salesforce connector, you can place the user in the Salesforce waiting queue even when no operator is available, as long as the queue is not full. To do this, use the following context condition:

* **SpaceLeftInWaitingQueue()**: only checks whether the queue entered in the **Queue Name** field has not reached its **Maximum Queue Capacity**. This condition does not check the opening hours or whether an operator is connected.

{% hint style="info" %}
When you enable the Salesforce connector, the "space left in waiting queue" condition, which uses **SpaceLeftInWaitingQueue()**, is created automatically in **Contents > Context Conditions**.
{% endhint %}

The **Connect Livechat** GUI action then behaves as follows:

* if the **LiveChatAvailable()** condition found an available operator, the user is connected directly to this operator;
* otherwise, if there is space left in the waiting queue, the user is placed in the Salesforce waiting queue. The conversation is assigned as soon as an operator is available.

To place the user in the waiting queue when no operator is available:

1. In your escalation knowledge, insert the condition using **LiveChatAvailable()**.
2. In the success branch, edit the answer, click on **More options** > **Other options** > **Set GUI action** and select **Connect Livechat**.
3. In the failure branch, insert the "space left in waiting queue" condition.
4. In the success branch of this second condition, enter the answer to display, then set the **Connect Livechat** GUI action as in step 2.

> Example: "All our advisors are busy. You have been placed in the waiting queue, an advisor will answer you as soon as possible."

5. In the failure branch, enter the answer to display when the waiting queue is full.

> Example: "Our waiting queue is full, please try again in a few moments."

6. Click on **Update**.

{% hint style="warning" %}
The **SpaceLeftInWaitingQueue()** condition is only available for the Salesforce connector.
{% endhint %}
