@salesforce/ui-bundle-template-feature-react-agentforce-conversation-client 9.9.2 → 9.9.4

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 CHANGED
@@ -50,6 +50,8 @@ export default function AppLayout() {
50
50
  | `styleTokens` | `Record<string, string>` | No | Theme tokens for chat UI styling. Merged with package defaults. |
51
51
  | `salesforceOrigin` | `string` | No | Salesforce org origin URL. Resolved automatically if not provided. |
52
52
  | `frontdoorUrl` | `string` | No | Frontdoor URL for authentication. Resolved automatically in dev if not provided. |
53
+ | `onReady` | `AgentforceReadyHandler` | No | Callback invoked when Lightning Out is ready. Receives the event detail. |
54
+ | `onError` | `AgentforceErrorHandler` | No | Callback invoked on Lightning Out errors. Receives `{ type, detail }`. |
53
55
 
54
56
  ### Rendering Modes
55
57
 
@@ -114,6 +116,26 @@ Use `showHeaderIcon` to explicitly show or hide the icon in the header.
114
116
  <AgentforceConversationClient agentId="0Xx000000000000AAA" showHeaderIcon={false} />
115
117
  ```
116
118
 
119
+ ### Error and ready callbacks
120
+
121
+ Use `onReady` and `onError` to react programmatically to Lightning Out lifecycle events — for example, to show a loading spinner until the agent is ready, or to report errors to an observability service.
122
+
123
+ ```tsx
124
+ <AgentforceConversationClient
125
+ agentId="0Xx000000000000AAA"
126
+ onReady={(detail) => {
127
+ console.log("Agent chat is ready", detail);
128
+ }}
129
+ onError={(error) => {
130
+ // error.type: "lo.application.error" | "lo.iframe.error"
131
+ // error.detail: the raw error payload from Lightning Out
132
+ reportError(error);
133
+ }}
134
+ />
135
+ ```
136
+
137
+ Both callbacks are optional. When omitted, the SDK still logs errors and readiness to the console.
138
+
117
139
  ### Wrapper defaults and initialization behavior
118
140
 
119
141
  This React wrapper applies a few defaults around the underlying SDK:
package/dist/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [9.9.4](https://github.com/salesforce-experience-platform-emu/webapps/compare/v9.9.3...v9.9.4) (2026-05-26)
7
+
8
+ **Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
9
+
10
+
11
+
12
+
13
+
14
+ ## [9.9.3](https://github.com/salesforce-experience-platform-emu/webapps/compare/v9.9.2...v9.9.3) (2026-05-25)
15
+
16
+ **Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
17
+
18
+
19
+
20
+
21
+
6
22
  ## [9.9.2](https://github.com/salesforce-experience-platform-emu/webapps/compare/v9.9.1...v9.9.2) (2026-05-25)
7
23
 
8
24
  **Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
@@ -13,38 +13,6 @@ import type {
13
13
  } from "../types/conversation";
14
14
 
15
15
  const GLOBAL_HOST_ID = "agentforce-conversation-client-global-host";
16
-
17
- const DEFAULT_STYLE_TOKENS: NonNullable<AgentforceClientConfig["styleTokens"]> = {
18
- containerBackground: "#fafafa",
19
-
20
- headerBlockBackground: "#372949",
21
- headerBlockTextColor: "#ffffff",
22
- headerBlockIconColor: "#ffffff",
23
- headerBlockBorderBottomColor: "#3b0764",
24
- headerBlockFocusBorder: "#c4b5fd",
25
-
26
- messageBlockInboundBackgroundColor: "#ffffff",
27
- messageBlockInboundTextColor: "#1f2937",
28
- messageBlockInboundBorder: "1px solid #e5e7eb",
29
-
30
- messageBlockOutboundBackgroundColor: "#ede9fe",
31
- messageBlockOutboundTextColor: "#1f2937",
32
- messageBlockOutboundBorder: "1px solid #d8b4fe",
33
-
34
- messageInputTextColor: "#1f2937",
35
- messageInputTextBackgroundColor: "#ffffff",
36
- messageInputFooterBorderColor: "#d1d5db",
37
- messageInputFooterBorderFocusColor: "#9ca3af",
38
- messageInputFocusShadow: "0 0 0 3px rgba(156, 163, 175, 0.25)",
39
- messageInputFooterPlaceholderText: "#6b7280",
40
-
41
- messageInputFooterSendButton: "#7e22ce",
42
- messageInputFooterSendButtonHoverColor: "#6b21a8",
43
- messageInputSendButtonIconColor: "#ffffff",
44
- messageInputSendButtonDisabledColor: "#e5e7eb",
45
- messageInputActionButtonFocusBorder: "#a855f7",
46
- errorBlockBackground: "#fafafa",
47
- };
48
16
  const SINGLETON_KEY = "__agentforceConversationClientSingleton";
49
17
 
50
18
  interface AgentforceConversationClientSingleton {
@@ -96,6 +64,8 @@ export function AgentforceConversationClient({
96
64
  styleTokens,
97
65
  salesforceOrigin,
98
66
  frontdoorUrl,
67
+ onReady,
68
+ onError,
99
69
  }: AgentforceConversationClientProps) {
100
70
  const containerRef = useRef<HTMLDivElement>(null);
101
71
  const normalizedAgentforceClientConfig = useMemo<AgentforceClientConfig>(() => {
@@ -111,7 +81,7 @@ export function AgentforceConversationClient({
111
81
  return {
112
82
  ...(agentId !== undefined && { agentId }),
113
83
  ...(agentLabel !== undefined && { agentLabel }),
114
- styleTokens: { ...DEFAULT_STYLE_TOKENS, ...styleTokens },
84
+ ...(styleTokens !== undefined && { styleTokens }),
115
85
  renderingConfig,
116
86
  channel: "Vibes",
117
87
  };
@@ -153,6 +123,8 @@ export function AgentforceConversationClient({
153
123
  salesforceOrigin: salesforceOrigin ?? options.salesforceOrigin,
154
124
  frontdoorUrl: frontdoorUrl ?? options.frontdoorUrl,
155
125
  agentforceClientConfig: normalizedAgentforceClientConfig,
126
+ onReady,
127
+ onError,
156
128
  });
157
129
  singleton.initialized = true;
158
130
  } catch (err) {
@@ -207,7 +179,7 @@ export function AgentforceConversationClient({
207
179
  // Intentionally no cleanup:
208
180
  // This component guarantees a single LO initialization per window.
209
181
  };
210
- }, [salesforceOrigin, frontdoorUrl, normalizedAgentforceClientConfig, inline]);
182
+ }, [salesforceOrigin, frontdoorUrl, normalizedAgentforceClientConfig, inline, onReady, onError]);
211
183
 
212
184
  if (!inline) {
213
185
  return null;
@@ -4,6 +4,11 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
 
7
+ import type {
8
+ AgentforceErrorHandler,
9
+ AgentforceReadyHandler,
10
+ } from "@salesforce/agentforce-conversation-client";
11
+
7
12
  export interface ResolvedEmbedOptions {
8
13
  salesforceOrigin?: string;
9
14
  frontdoorUrl?: string;
@@ -32,4 +37,8 @@ export interface AgentforceConversationClientProps {
32
37
  salesforceOrigin?: string;
33
38
  /** Optional. If not provided, resolved internally in dev via /__lo/frontdoor. */
34
39
  frontdoorUrl?: string;
40
+ /** Callback invoked when the Lightning Out application is ready. */
41
+ onReady?: AgentforceReadyHandler;
42
+ /** Callback invoked when a Lightning Out error occurs. */
43
+ onError?: AgentforceErrorHandler;
35
44
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@salesforce/webapp-template-base-sfdx-project-experimental",
3
- "version": "9.9.2",
3
+ "version": "9.9.4",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@salesforce/webapp-template-base-sfdx-project-experimental",
9
- "version": "9.9.2",
9
+ "version": "9.9.4",
10
10
  "license": "SEE LICENSE IN LICENSE.txt",
11
11
  "devDependencies": {
12
12
  "@lwc/eslint-plugin-lwc": "^3.3.0",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/ui-bundle-template-base-sfdx-project",
3
- "version": "9.9.2",
3
+ "version": "9.9.4",
4
4
  "description": "Base SFDX project template",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "publishConfig": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/ui-bundle-template-feature-react-agentforce-conversation-client",
3
- "version": "9.9.2",
3
+ "version": "9.9.4",
4
4
  "description": "Embedded Agentforce conversation client feature for UI Bundles",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "",
@@ -26,7 +26,7 @@
26
26
  "clean": "rm -rf dist"
27
27
  },
28
28
  "dependencies": {
29
- "@salesforce/agentforce-conversation-client": "^9.9.2"
29
+ "@salesforce/agentforce-conversation-client": "^9.9.4"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/react": "^19.2.7",
@@ -13,38 +13,6 @@ import type {
13
13
  } from "../types/conversation";
14
14
 
15
15
  const GLOBAL_HOST_ID = "agentforce-conversation-client-global-host";
16
-
17
- const DEFAULT_STYLE_TOKENS: NonNullable<AgentforceClientConfig["styleTokens"]> = {
18
- containerBackground: "#fafafa",
19
-
20
- headerBlockBackground: "#372949",
21
- headerBlockTextColor: "#ffffff",
22
- headerBlockIconColor: "#ffffff",
23
- headerBlockBorderBottomColor: "#3b0764",
24
- headerBlockFocusBorder: "#c4b5fd",
25
-
26
- messageBlockInboundBackgroundColor: "#ffffff",
27
- messageBlockInboundTextColor: "#1f2937",
28
- messageBlockInboundBorder: "1px solid #e5e7eb",
29
-
30
- messageBlockOutboundBackgroundColor: "#ede9fe",
31
- messageBlockOutboundTextColor: "#1f2937",
32
- messageBlockOutboundBorder: "1px solid #d8b4fe",
33
-
34
- messageInputTextColor: "#1f2937",
35
- messageInputTextBackgroundColor: "#ffffff",
36
- messageInputFooterBorderColor: "#d1d5db",
37
- messageInputFooterBorderFocusColor: "#9ca3af",
38
- messageInputFocusShadow: "0 0 0 3px rgba(156, 163, 175, 0.25)",
39
- messageInputFooterPlaceholderText: "#6b7280",
40
-
41
- messageInputFooterSendButton: "#7e22ce",
42
- messageInputFooterSendButtonHoverColor: "#6b21a8",
43
- messageInputSendButtonIconColor: "#ffffff",
44
- messageInputSendButtonDisabledColor: "#e5e7eb",
45
- messageInputActionButtonFocusBorder: "#a855f7",
46
- errorBlockBackground: "#fafafa",
47
- };
48
16
  const SINGLETON_KEY = "__agentforceConversationClientSingleton";
49
17
 
50
18
  interface AgentforceConversationClientSingleton {
@@ -96,6 +64,8 @@ export function AgentforceConversationClient({
96
64
  styleTokens,
97
65
  salesforceOrigin,
98
66
  frontdoorUrl,
67
+ onReady,
68
+ onError,
99
69
  }: AgentforceConversationClientProps) {
100
70
  const containerRef = useRef<HTMLDivElement>(null);
101
71
  const normalizedAgentforceClientConfig = useMemo<AgentforceClientConfig>(() => {
@@ -111,7 +81,7 @@ export function AgentforceConversationClient({
111
81
  return {
112
82
  ...(agentId !== undefined && { agentId }),
113
83
  ...(agentLabel !== undefined && { agentLabel }),
114
- styleTokens: { ...DEFAULT_STYLE_TOKENS, ...styleTokens },
84
+ ...(styleTokens !== undefined && { styleTokens }),
115
85
  renderingConfig,
116
86
  channel: "Vibes",
117
87
  };
@@ -153,6 +123,8 @@ export function AgentforceConversationClient({
153
123
  salesforceOrigin: salesforceOrigin ?? options.salesforceOrigin,
154
124
  frontdoorUrl: frontdoorUrl ?? options.frontdoorUrl,
155
125
  agentforceClientConfig: normalizedAgentforceClientConfig,
126
+ onReady,
127
+ onError,
156
128
  });
157
129
  singleton.initialized = true;
158
130
  } catch (err) {
@@ -207,7 +179,7 @@ export function AgentforceConversationClient({
207
179
  // Intentionally no cleanup:
208
180
  // This component guarantees a single LO initialization per window.
209
181
  };
210
- }, [salesforceOrigin, frontdoorUrl, normalizedAgentforceClientConfig, inline]);
182
+ }, [salesforceOrigin, frontdoorUrl, normalizedAgentforceClientConfig, inline, onReady, onError]);
211
183
 
212
184
  if (!inline) {
213
185
  return null;
@@ -4,6 +4,11 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
 
7
+ import type {
8
+ AgentforceErrorHandler,
9
+ AgentforceReadyHandler,
10
+ } from "@salesforce/agentforce-conversation-client";
11
+
7
12
  export interface ResolvedEmbedOptions {
8
13
  salesforceOrigin?: string;
9
14
  frontdoorUrl?: string;
@@ -32,4 +37,8 @@ export interface AgentforceConversationClientProps {
32
37
  salesforceOrigin?: string;
33
38
  /** Optional. If not provided, resolved internally in dev via /__lo/frontdoor. */
34
39
  frontdoorUrl?: string;
40
+ /** Callback invoked when the Lightning Out application is ready. */
41
+ onReady?: AgentforceReadyHandler;
42
+ /** Callback invoked when a Lightning Out error occurs. */
43
+ onError?: AgentforceErrorHandler;
35
44
  }