@salesforce/webapp-template-feature-react-agentforce-conversation-client-experimental 1.22.1 → 1.24.0

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/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
+ # [1.24.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.23.0...v1.24.0) (2026-02-11)
7
+
8
+ **Note:** Version bump only for package @salesforce/webapp-template-base-sfdx-project-experimental
9
+
10
+
11
+
12
+
13
+
14
+ # [1.23.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.22.1...v1.23.0) (2026-02-11)
15
+
16
+ **Note:** Version bump only for package @salesforce/webapp-template-base-sfdx-project-experimental
17
+
18
+
19
+
20
+
21
+
6
22
  ## [1.22.1](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.22.0...v1.22.1) (2026-02-11)
7
23
 
8
24
  **Note:** Version bump only for package @salesforce/webapp-template-base-sfdx-project-experimental
@@ -8,7 +8,7 @@
8
8
  "name": "base-react-app",
9
9
  "version": "1.0.0",
10
10
  "dependencies": {
11
- "@salesforce/agentforce-conversation-client": "^1.22.0",
11
+ "@salesforce/agentforce-conversation-client": "^1.23.0",
12
12
  "@salesforce/webapp-experimental": "*",
13
13
  "@tailwindcss/vite": "^4.1.17",
14
14
  "react": "^19.2.0",
@@ -1863,9 +1863,9 @@
1863
1863
  ]
1864
1864
  },
1865
1865
  "node_modules/@salesforce/agentforce-conversation-client": {
1866
- "version": "1.22.0",
1867
- "resolved": "https://registry.npmjs.org/@salesforce/agentforce-conversation-client/-/agentforce-conversation-client-1.22.0.tgz",
1868
- "integrity": "sha512-PrR6v7iaifIFNp+L7Rnj/2DHUYIz+d7AGLlJJU4zOXBGqNi1777Y4J46ILPe9lXnKBbyo6AIptnkyIOSEn3Z5w==",
1866
+ "version": "1.23.0",
1867
+ "resolved": "https://registry.npmjs.org/@salesforce/agentforce-conversation-client/-/agentforce-conversation-client-1.23.0.tgz",
1868
+ "integrity": "sha512-WKiZz4N8MyOtA8OVBt6+laFbsF0O3bYK/Ke64DIMWG/j3bvNF21mOXrI3y/oTeC6Oio0/jJx/+wuuCXaYG63Rg==",
1869
1869
  "license": "SEE LICENSE IN LICENSE.txt",
1870
1870
  "dependencies": {
1871
1871
  "@lightning-out/application": "2.1.1-rc.2"
@@ -12,7 +12,7 @@
12
12
  "test": "vitest"
13
13
  },
14
14
  "dependencies": {
15
- "@salesforce/agentforce-conversation-client": "^1.22.0",
15
+ "@salesforce/agentforce-conversation-client": "^1.23.0",
16
16
  "@salesforce/webapp-experimental": "*",
17
17
  "@tailwindcss/vite": "^4.1.17",
18
18
  "react": "^19.2.0",
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  import { Outlet } from "react-router";
8
- import AgentforceConversationClient from "./AgentforceConversationClient.tsx";
8
+ import AgentforceConversationClient from "./components/AgentforceConversationClient";
9
9
 
10
10
  export default function AppLayout(): React.ReactElement {
11
11
  return (
@@ -6,15 +6,13 @@
6
6
 
7
7
  import {
8
8
  embedAgentforceClient,
9
- type AgentforceClientConfig,
10
9
  type EmbedAgentforceClientResult,
11
10
  } from "@salesforce/agentforce-conversation-client";
12
11
  import { useEffect, useRef } from "react";
13
-
14
- export interface ResolvedEmbedOptions {
15
- salesforceOrigin?: string;
16
- frontdoorUrl?: string;
17
- }
12
+ import type {
13
+ ResolvedEmbedOptions,
14
+ AgentforceConversationClientProps,
15
+ } from "../types/conversation";
18
16
 
19
17
  async function resolveEmbedOptions(): Promise<ResolvedEmbedOptions> {
20
18
  if (window.location.hostname === "localhost") {
@@ -26,21 +24,12 @@ async function resolveEmbedOptions(): Promise<ResolvedEmbedOptions> {
26
24
  return { salesforceOrigin: window.location.origin };
27
25
  }
28
26
 
29
- export interface AgentforceConversationClientProps {
30
- /** Optional config from consumer. Passed through to the embed client as-is. */
31
- agentforceClientConfig?: AgentforceClientConfig;
32
- /** Optional. If not provided, resolved internally (e.g. from /__lo/frontdoor in dev, window.location.origin in prod). */
33
- salesforceOrigin?: string;
34
- /** Optional. If not provided, resolved internally in dev via /__lo/frontdoor. */
35
- frontdoorUrl?: string;
36
- }
37
-
38
27
  /**
39
28
  * React wrapper that embeds the Agentforce Conversation Client (copilot/agent UI)
40
29
  * using Lightning Out. Requires a valid Salesforce session for the given org.
41
30
  * Config is passed through from the consumer to the embed client as-is.
42
31
  */
43
- export default function AgentforceConversationClient({
32
+ export function AgentforceConversationClient({
44
33
  agentforceClientConfig,
45
34
  salesforceOrigin,
46
35
  frontdoorUrl,
@@ -79,3 +68,5 @@ export default function AgentforceConversationClient({
79
68
  />
80
69
  );
81
70
  }
71
+
72
+ export default AgentforceConversationClient;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * feature-react-agentforce-conversation-client – ACC Conversation Client
3
+ */
4
+
5
+ export { AgentforceConversationClient } from "./components/AgentforceConversationClient";
6
+ export type { AgentforceConversationClientProps, ResolvedEmbedOptions } from "./types/conversation";
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ import type { AgentforceClientConfig } from "@salesforce/agentforce-conversation-client";
8
+
9
+ export interface ResolvedEmbedOptions {
10
+ salesforceOrigin?: string;
11
+ frontdoorUrl?: string;
12
+ }
13
+
14
+ export interface AgentforceConversationClientProps {
15
+ /** Optional config from consumer. Passed through to the embed client as-is. */
16
+ agentforceClientConfig?: AgentforceClientConfig;
17
+ /** Optional. If not provided, resolved internally (e.g. from /__lo/frontdoor in dev, window.location.origin in prod). */
18
+ salesforceOrigin?: string;
19
+ /** Optional. If not provided, resolved internally in dev via /__lo/frontdoor. */
20
+ frontdoorUrl?: string;
21
+ }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/webapp-template-base-sfdx-project-experimental",
3
- "version": "1.22.1",
3
+ "version": "1.24.0",
4
4
  "description": "Base SFDX project template",
5
5
  "private": true,
6
6
  "files": [
package/package.json CHANGED
@@ -1,13 +1,22 @@
1
1
  {
2
2
  "name": "@salesforce/webapp-template-feature-react-agentforce-conversation-client-experimental",
3
- "version": "1.22.1",
3
+ "version": "1.24.0",
4
4
  "description": "Embedded Agentforce conversation client feature for web applications",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "",
7
7
  "type": "module",
8
- "main": "index.js",
8
+ "main": "src/force-app/main/default/webapplications/feature-react-agentforce-conversation-client/src/index.ts",
9
+ "types": "src/force-app/main/default/webapplications/feature-react-agentforce-conversation-client/src/index.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./src/force-app/main/default/webapplications/feature-react-agentforce-conversation-client/src/index.ts",
13
+ "import": "./src/force-app/main/default/webapplications/feature-react-agentforce-conversation-client/src/index.ts",
14
+ "default": "./src/force-app/main/default/webapplications/feature-react-agentforce-conversation-client/src/index.ts"
15
+ }
16
+ },
9
17
  "files": [
10
- "dist"
18
+ "dist",
19
+ "src"
11
20
  ],
12
21
  "publishConfig": {
13
22
  "access": "public"
@@ -25,5 +34,5 @@
25
34
  "react-dom": "^19.2.1",
26
35
  "react-router": "^7.10.1"
27
36
  },
28
- "gitHead": "b07f50207ad2ffe2f2edf124fc373731d4101f51"
37
+ "gitHead": "7bb4b5adf5f2071b38ecf1c7b180f87ec9f71afc"
29
38
  }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ import { Outlet } from "react-router";
8
+ import AgentforceConversationClient from "./components/AgentforceConversationClient";
9
+
10
+ export default function AppLayout(): React.ReactElement {
11
+ return (
12
+ <>
13
+ <Outlet />
14
+ <AgentforceConversationClient />
15
+ </>
16
+ );
17
+ }
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ import {
8
+ embedAgentforceClient,
9
+ type EmbedAgentforceClientResult,
10
+ } from "@salesforce/agentforce-conversation-client";
11
+ import { useEffect, useRef } from "react";
12
+ import type {
13
+ ResolvedEmbedOptions,
14
+ AgentforceConversationClientProps,
15
+ } from "../types/conversation";
16
+
17
+ async function resolveEmbedOptions(): Promise<ResolvedEmbedOptions> {
18
+ if (window.location.hostname === "localhost") {
19
+ const res = await fetch("/__lo/frontdoor");
20
+ if (!res.ok) console.error("frontdoor fetch failed");
21
+ const { frontdoorUrl } = await res.json();
22
+ return { frontdoorUrl: frontdoorUrl };
23
+ }
24
+ return { salesforceOrigin: window.location.origin };
25
+ }
26
+
27
+ /**
28
+ * React wrapper that embeds the Agentforce Conversation Client (copilot/agent UI)
29
+ * using Lightning Out. Requires a valid Salesforce session for the given org.
30
+ * Config is passed through from the consumer to the embed client as-is.
31
+ */
32
+ export function AgentforceConversationClient({
33
+ agentforceClientConfig,
34
+ salesforceOrigin,
35
+ frontdoorUrl,
36
+ }: AgentforceConversationClientProps) {
37
+ const containerRef = useRef<HTMLDivElement>(null);
38
+ const embedResultRef = useRef<EmbedAgentforceClientResult | null>(null);
39
+
40
+ useEffect(() => {
41
+ const container = containerRef.current;
42
+ if (!container) return;
43
+
44
+ resolveEmbedOptions().then((options) => {
45
+ try {
46
+ const result = embedAgentforceClient({
47
+ container,
48
+ salesforceOrigin: salesforceOrigin ?? options.salesforceOrigin,
49
+ frontdoorUrl: frontdoorUrl ?? options.frontdoorUrl,
50
+ agentforceClientConfig: agentforceClientConfig,
51
+ });
52
+ embedResultRef.current = result;
53
+ } catch (err) {
54
+ console.error("AgentforceConversationClient: failed to embed Agentforce client", err);
55
+ }
56
+ });
57
+
58
+ return () => {
59
+ embedResultRef.current = null;
60
+ };
61
+ }, [salesforceOrigin, frontdoorUrl, agentforceClientConfig]);
62
+
63
+ return (
64
+ <div
65
+ ref={containerRef}
66
+ className="agentforce-conversation-client-container"
67
+ id="agentforce-conversation-client-container"
68
+ />
69
+ );
70
+ }
71
+
72
+ export default AgentforceConversationClient;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * feature-react-agentforce-conversation-client – ACC Conversation Client
3
+ */
4
+
5
+ export { AgentforceConversationClient } from "./components/AgentforceConversationClient";
6
+ export type { AgentforceConversationClientProps, ResolvedEmbedOptions } from "./types/conversation";
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ import type { AgentforceClientConfig } from "@salesforce/agentforce-conversation-client";
8
+
9
+ export interface ResolvedEmbedOptions {
10
+ salesforceOrigin?: string;
11
+ frontdoorUrl?: string;
12
+ }
13
+
14
+ export interface AgentforceConversationClientProps {
15
+ /** Optional config from consumer. Passed through to the embed client as-is. */
16
+ agentforceClientConfig?: AgentforceClientConfig;
17
+ /** Optional. If not provided, resolved internally (e.g. from /__lo/frontdoor in dev, window.location.origin in prod). */
18
+ salesforceOrigin?: string;
19
+ /** Optional. If not provided, resolved internally in dev via /__lo/frontdoor. */
20
+ frontdoorUrl?: string;
21
+ }