@salesforce/agentforce-conversation-client 1.122.0 → 1.122.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
> **Beta**: This package is currently in beta. APIs and behavior may change in future releases.
|
|
4
4
|
|
|
5
|
-
Agentforce Conversation Client SDK
|
|
5
|
+
The Agentforce Conversation Client SDK enables embedding the Agentforce chat experience for employee agents into external applications.
|
|
6
6
|
|
|
7
7
|
## Overview
|
|
8
8
|
|
|
9
|
-
This library embeds the Agentforce Conversation Client
|
|
9
|
+
This library embeds the Agentforce Conversation Client for employee agents using Lightning Out 2.0.
|
|
10
10
|
|
|
11
11
|
## Prerequisites
|
|
12
12
|
|
|
13
13
|
- **One of `salesforceOrigin` or `frontdoorUrl` is required.**
|
|
14
14
|
- Use `salesforceOrigin` when your app is hosted inside a Salesforce org and already has an authenticated session.
|
|
15
15
|
- Use `frontdoorUrl` when embedding the chat client outside Salesforce (for example, a localhost or external app).
|
|
16
|
-
- Lightning Out uses an existing session to initialize; without it, the embed will fail to start.
|
|
16
|
+
- Lightning Out 2.0 uses an existing session to initialize; without it, the embed will fail to start.
|
|
17
17
|
|
|
18
18
|
## Installation
|
|
19
19
|
|
|
@@ -143,6 +143,10 @@ const { loApp, chatClientComponent } = embedAgentforceClient({
|
|
|
143
143
|
});
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
+
### Style Token Reference
|
|
147
|
+
|
|
148
|
+
Share: [Style Token Reference](#style-token-tables)
|
|
149
|
+
|
|
146
150
|
### Container
|
|
147
151
|
|
|
148
152
|
| Token name | UI area themed |
|
|
@@ -232,7 +236,7 @@ Use `renderingConfig.showAvatar` to control whether avatars are rendered in mess
|
|
|
232
236
|
|
|
233
237
|
| Token name | UI area themed |
|
|
234
238
|
| ----------------------------------------- | --------------------------------- |
|
|
235
|
-
| `
|
|
239
|
+
| `inboundMessageTextColor` | Inbound message text color (base) |
|
|
236
240
|
| `messageBlockInboundBorderRadius` | Inbound message border radius |
|
|
237
241
|
| `messageBlockInboundBackgroundColor` | Inbound message background |
|
|
238
242
|
| `messageBlockInboundTextColor` | Inbound message text color |
|
|
@@ -325,7 +329,7 @@ const { loApp, chatClientComponent } = embedAgentforceClient({
|
|
|
325
329
|
});
|
|
326
330
|
```
|
|
327
331
|
|
|
328
|
-
### With Lightning Out App ID
|
|
332
|
+
### With Lightning Out 2.0 App ID
|
|
329
333
|
|
|
330
334
|
```typescript
|
|
331
335
|
import { embedAgentforceClient } from "@salesforce/agentforce-conversation-client";
|
|
@@ -346,7 +350,7 @@ const { loApp } = embedAgentforceClient({
|
|
|
346
350
|
});
|
|
347
351
|
|
|
348
352
|
loApp.addEventListener("lo.application.ready", () => {
|
|
349
|
-
console.log("Lightning Out is ready");
|
|
353
|
+
console.log("Lightning Out 2.0 is ready");
|
|
350
354
|
});
|
|
351
355
|
|
|
352
356
|
loApp.addEventListener("lo.component.ready", (event) => {
|
|
@@ -362,16 +366,18 @@ loApp.addEventListener("lo.application.error", (event) => {
|
|
|
362
366
|
|
|
363
367
|
### `embedAgentforceClient(options)`
|
|
364
368
|
|
|
365
|
-
Embeds the Agentforce Conversation Client
|
|
369
|
+
Embeds the Agentforce Conversation Client by creating a Lightning Out 2.0 app and chat wrapper under the provided container. In floating mode, the chat is displayed as a fixed overlay; in inline mode, it renders within the container layout.
|
|
370
|
+
|
|
371
|
+
> Note: The embed is initially hidden and becomes visible after the chat wrapper dispatches the `accready` event.
|
|
366
372
|
|
|
367
373
|
#### Parameters
|
|
368
374
|
|
|
369
375
|
| Parameter | Type | Required | Description |
|
|
370
376
|
| ------------------------------------------------------- | ------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
371
377
|
| `options.container` | `string \| HTMLElement` | Yes | CSS selector or HTMLElement to embed into |
|
|
372
|
-
| `options.salesforceOrigin` | `string` | No | Salesforce org origin URL (use when hosted in a Salesforce org)
|
|
378
|
+
| `options.salesforceOrigin` | `string` | No | Salesforce org origin URL (use when hosted in a Salesforce org). At least one of `salesforceOrigin` or `frontdoorUrl` is required |
|
|
373
379
|
| `options.appId` | `string` | No | 18-digit Lightning Out 2.0 app ID (`app-id`); find it in Lightning Out 2.0 App Manager in Setup; not required for apps created before Spring '26 |
|
|
374
|
-
| `options.frontdoorUrl` | `string` | No | Frontdoor URL for authentication (use when embedding outside Salesforce)
|
|
380
|
+
| `options.frontdoorUrl` | `string` | No | Frontdoor URL for authentication (use when embedding outside Salesforce). At least one of `salesforceOrigin` or `frontdoorUrl` is required |
|
|
375
381
|
| `options.agentforceClientConfig` | `AgentforceClientConfig` | No | Configuration for the Agentforce client (see sub-properties below) |
|
|
376
382
|
| `agentforceClientConfig.agentId` | `string` | Yes\* | The agent to load — required in practice, will not work without it |
|
|
377
383
|
| `agentforceClientConfig.agentLabel` | `string` | No | Display name shown in the chat header. Falls back to the agent's configured name if omitted |
|
|
@@ -387,7 +393,7 @@ Embeds the Agentforce Conversation Client into a specified DOM container. By def
|
|
|
387
393
|
|
|
388
394
|
| Property | Type | Description |
|
|
389
395
|
| --------------------- | ------------------------- | --------------------------------- |
|
|
390
|
-
| `loApp` | `LightningOutApplication` | The Lightning Out application
|
|
396
|
+
| `loApp` | `LightningOutApplication` | The Lightning Out 2.0 application |
|
|
391
397
|
| `chatClientComponent` | `HTMLElement` | The chat client component element |
|
|
392
398
|
|
|
393
399
|
## Types
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/agentforce-conversation-client",
|
|
3
3
|
"description": "Agentforce Conversation Client SDK for embedding via Lightning Out 2.0",
|
|
4
|
-
"version": "1.122.
|
|
4
|
+
"version": "1.122.1",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|