@salesforce/webapp-template-feature-react-agentforce-conversation-client-experimental 1.33.0 → 1.33.2

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 ADDED
@@ -0,0 +1,211 @@
1
+ # Agentforce Conversation Client (React)
2
+
3
+ React component for embedding the Agentforce Conversation Client — the Salesforce agent chat UI — into a web application. This is a wrapper around `@salesforce/agentforce-conversation-client` that handles authentication automatically and provides a declarative `<AgentforceConversationClient />` component.
4
+
5
+ Use this when a user expects to add an agent, chat widget, chatbot, conversation client, Agentforce chat, employee agent, service agent, or any Salesforce agent to their React app.
6
+
7
+ ## How it works
8
+
9
+ The component embeds the Agentforce chat experience using Lightning Out 2.0. Authentication is resolved automatically:
10
+
11
+ - **Dev (localhost)**: fetches a `frontdoorUrl` from `/__lo/frontdoor`
12
+ - **Prod (hosted in org)**: uses `window.location.origin` as `salesforceOrigin`
13
+
14
+ ## Step 1: Install dependencies
15
+
16
+ ```bash
17
+ npm install @salesforce/agentforce-conversation-client
18
+ npm install @salesforce/webapp-template-feature-react-agentforce-conversation-client-experimental
19
+ ```
20
+
21
+ ## Step 2: Embed in the app layout
22
+
23
+ ```tsx
24
+ import { AgentforceConversationClient } from "@salesforce/webapp-template-feature-react-agentforce-conversation-client-experimental";
25
+
26
+ export default function AppLayout() {
27
+ return (
28
+ <>
29
+ <Outlet />
30
+ <AgentforceConversationClient />
31
+ </>
32
+ );
33
+ }
34
+ ```
35
+
36
+ ## Step 3: Configure (optional)
37
+
38
+ ### Props
39
+
40
+ | Prop | Type | Required | Description |
41
+ | ------------------------ | ------------------------ | -------- | ------------------------------------------------------------------------------------------------------ |
42
+ | `agentforceClientConfig` | `AgentforceClientConfig` | No | Configuration object passed through to the embed client (agent ID, rendering mode, style tokens, etc.) |
43
+ | `salesforceOrigin` | `string` | No | Salesforce org origin URL. Resolved automatically if not provided. |
44
+ | `frontdoorUrl` | `string` | No | Frontdoor URL for authentication. Resolved automatically in dev if not provided. |
45
+
46
+ ### Rendering Modes
47
+
48
+ #### Floating (default)
49
+
50
+ A persistent chat widget overlay pinned to the bottom-right corner. No extra config needed.
51
+
52
+ ```tsx
53
+ <AgentforceConversationClient />
54
+ ```
55
+
56
+ #### Inline
57
+
58
+ The chat renders within the page layout at a specific size.
59
+
60
+ ```tsx
61
+ <AgentforceConversationClient
62
+ agentforceClientConfig={{
63
+ renderingConfig: { mode: "inline", width: 420, height: 600 },
64
+ }}
65
+ />
66
+ ```
67
+
68
+ ### Agent Selection
69
+
70
+ Pass `agentId` to load a specific agent (e.g. travel agent, HR agent). If not provided, the org's default agent is used.
71
+
72
+ ```tsx
73
+ <AgentforceConversationClient
74
+ agentforceClientConfig={{
75
+ agentId: "0Xx000000000000",
76
+ }}
77
+ />
78
+ ```
79
+
80
+ ### Theming with `styleTokens`
81
+
82
+ Use `agentforceClientConfig.styleTokens` to theme the Agentforce Conversation Client. Only override the tokens you need.
83
+
84
+ ```tsx
85
+ <AgentforceConversationClient
86
+ agentforceClientConfig={{
87
+ styleTokens: {
88
+ headerBlockBackground: "#0176d3",
89
+ headerBlockTextColor: "#ffffff",
90
+ messageBlockInboundBackgroundColor: "#0176d3",
91
+ },
92
+ }}
93
+ />
94
+ ```
95
+
96
+ #### Available Style Tokens
97
+
98
+ ##### Agentforce Header
99
+
100
+ | Token name | UI area themed |
101
+ | ----------------------------- | ------------------------ |
102
+ | `headerBlockBackground` | Header background |
103
+ | `headerBlockBorderColor` | Header border |
104
+ | `headerBlockFontFamily` | Header font family |
105
+ | `headerBlockTextColor` | Header text color |
106
+ | `headerBlockHoverBackground` | Header hover background |
107
+ | `headerBlockActiveBackground` | Header active background |
108
+ | `headerBlockFocusBorder` | Header focus border |
109
+
110
+ ##### Agentforce Messages
111
+
112
+ | Token name | UI area themed |
113
+ | -------------------------------- | ---------------------------------- |
114
+ | `messageBlockBodyPaddingBottom` | Message block body bottom padding |
115
+ | `messageBlockTextPadding` | Message block text padding |
116
+ | `messageBlockPaddingContainer` | Message block container padding |
117
+ | `messageBlockContainerMarginTop` | Message block container top margin |
118
+ | `messageBlockPadding` | Message block padding |
119
+ | `messageBlockBorderRadius` | Message block border radius |
120
+ | `messageBlockFontSize` | Message block font size |
121
+ | `messageBlockLineHeight` | Message block line height |
122
+ | `messageBlockBackgroundColor` | Message block background (base) |
123
+ | `messageBlockBodyWidth` | Message block body width |
124
+
125
+ ##### Inbound message (customer to agent)
126
+
127
+ | Token name | UI area themed |
128
+ | ----------------------------------------- | -------------------------------- |
129
+ | `messageBlockInboundHoverBackgroundColor` | Inbound message hover background |
130
+ | `messageBlockInboundBackgroundColor` | Inbound message background |
131
+ | `messageBlockInboundTextColor` | Inbound message text color |
132
+ | `messageBlockInboundWidth` | Inbound message width |
133
+ | `messageBlockInboundTextAlign` | Inbound message text alignment |
134
+
135
+ ##### Outbound message (agent to customer)
136
+
137
+ | Token name | UI area themed |
138
+ | ------------------------------------- | ------------------------------- |
139
+ | `messageBlockOutboundBackgroundColor` | Outbound message background |
140
+ | `messageBlockOutboundTextColor` | Outbound message text color |
141
+ | `messageBlockOutboundWidth` | Outbound message width |
142
+ | `messageBlockOutboundMarginLeft` | Outbound message left margin |
143
+ | `messageBlockOutboundTextAlign` | Outbound message text alignment |
144
+
145
+ ##### Agentforce Input
146
+
147
+ | Token name | UI area themed |
148
+ | ---------------------------------------- | ---------------------------------------------- |
149
+ | `messageInputPadding` | Message input container padding |
150
+ | `messageInputBorderRadius` | Message input border radius |
151
+ | `messageInputFooterBorderColor` | Message input footer border color |
152
+ | `messageInputFooterBorderFocusColor` | Message input footer focus border color |
153
+ | `messageInputBorderTransitionDuration` | Message input border transition duration |
154
+ | `messageInputBorderTransitionEasing` | Message input border transition easing |
155
+ | `messageInputTextColor` | Message input text color |
156
+ | `messageInputTextBackgroundColor` | Message input text background color |
157
+ | `messageInputFooterPlaceholderText` | Message input placeholder text color |
158
+ | `messageInputErrorTextColor` | Message input error text color |
159
+ | `messageInputFontSize` | Message input font size |
160
+ | `messageInputFontWeight` | Message input font weight |
161
+ | `messageInputPlaceholderFontWeight` | Placeholder font weight |
162
+ | `messageInputLineHeight` | Message input line height |
163
+ | `messageInputMaxHeight` | Message input max height |
164
+ | `messageInputTextPadding` | Message input text padding |
165
+ | `messageInputActionsWidth` | Message input actions width |
166
+ | `messageInputActionsPaddingRight` | Message input actions right padding |
167
+ | `messageInputActionsGap` | Message input actions gap |
168
+ | `messageInputActionsPadding` | Message input actions padding |
169
+ | `messageInputOverflowY` | Message input overflow Y |
170
+ | `messageInputScrollbarWidth` | Message input scrollbar width |
171
+ | `messageInputScrollbarColor` | Message input scrollbar color |
172
+ | `messageInputTextareaMaxHeight` | Message input textarea max height |
173
+ | `messageInputTextareaWithImageMaxHeight` | Message input textarea max height (with image) |
174
+ | `messageInputFilePreviewPadding` | Message input file preview padding |
175
+ | `messageInputActionButtonSize` | Message input action button size |
176
+ | `messageInputActionButtonRadius` | Message input action button radius |
177
+ | `messageInputActionButtonFocusBorder` | Message input action button focus border |
178
+ | `messageInputActionButtonHoverShadow` | Message input action button hover shadow |
179
+ | `messageInputFooterSendButton` | Message input send button color |
180
+ | `messageInputFooterSendButtonHoverColor` | Message input send button hover color |
181
+ | `messageInputSendButtonDisabledColor` | Message input send button disabled color |
182
+
183
+ ### Prerequisites
184
+
185
+ - **One of `salesforceOrigin` or `frontdoorUrl` is required** (resolved automatically by the component).
186
+ - Use `salesforceOrigin` when your app is hosted inside a Salesforce org and already has an authenticated session.
187
+ - Use `frontdoorUrl` when embedding the chat client outside Salesforce (e.g. localhost or an external app).
188
+ - The org must allow `localhost:<PORT>` in **Trusted Domains for Inline Frames** (session settings) for local development.
189
+
190
+ ### Underlying SDK
191
+
192
+ This component wraps `@salesforce/agentforce-conversation-client`. For lower-level usage (vanilla JS, non-React frameworks), see the [Agentforce Conversation Client SDK](https://www.npmjs.com/package/@salesforce/agentforce-conversation-client).
193
+
194
+ ---
195
+
196
+ ## Rules and Skills
197
+
198
+ This package includes coding-agent rules and skills for automated workflows:
199
+
200
+ - **Rule** (`rules/embedded-agent-rule.md`): Conventions for which component to use, authentication, rendering modes, and placement. Copy into `.cursor/rules/` (Cursor) or `.clinerules/` (Cline).
201
+ - **Skill** (`skills/embedded-agent/`): Step-by-step workflow for embedding the agent — install, add component, configure mode/theming/agent. Copy into `.cursor/skills/` (Cursor) or `.cline/skills/` (Cline).
202
+
203
+ ---
204
+
205
+ ## Development
206
+
207
+ ```bash
208
+ npm run build # apply patches -> dist
209
+ npm run dev # run from dist
210
+ npm run watch # watch and re-apply
211
+ ```
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.33.2](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.33.1...v1.33.2) (2026-02-17)
7
+
8
+ **Note:** Version bump only for package @salesforce/webapp-template-base-sfdx-project-experimental
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.33.1](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.33.0...v1.33.1) (2026-02-17)
15
+
16
+ **Note:** Version bump only for package @salesforce/webapp-template-base-sfdx-project-experimental
17
+
18
+
19
+
20
+
21
+
6
22
  # [1.33.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.32.0...v1.33.0) (2026-02-17)
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.32.0",
11
+ "@salesforce/agentforce-conversation-client": "^1.33.1",
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.32.0",
1867
- "resolved": "https://registry.npmjs.org/@salesforce/agentforce-conversation-client/-/agentforce-conversation-client-1.32.0.tgz",
1868
- "integrity": "sha512-0aBjEjh7cgnP+Ktp6TprYJpizcyzSPrSc5QdwBgaDzYnCfoAahgEIljOp7UGka3UakdGW9aj3RmyNPo+KKEbNQ==",
1866
+ "version": "1.33.1",
1867
+ "resolved": "https://registry.npmjs.org/@salesforce/agentforce-conversation-client/-/agentforce-conversation-client-1.33.1.tgz",
1868
+ "integrity": "sha512-Su/L1lqsGZwh1ellGXNgoZYr6K2cwR2/dw+N0j3dC1KFW/essABmwb6W4fE2pjCdd5eVup3jvIjKkI/i2YGphg==",
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.32.0",
15
+ "@salesforce/agentforce-conversation-client": "^1.33.1",
16
16
  "@salesforce/webapp-experimental": "*",
17
17
  "@tailwindcss/vite": "^4.1.17",
18
18
  "react": "^19.2.0",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/webapp-template-base-sfdx-project-experimental",
3
- "version": "1.33.0",
3
+ "version": "1.33.2",
4
4
  "description": "Base SFDX project template",
5
5
  "private": true,
6
6
  "files": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/webapp-template-feature-react-agentforce-conversation-client-experimental",
3
- "version": "1.33.0",
3
+ "version": "1.33.2",
4
4
  "description": "Embedded Agentforce conversation client feature for web applications",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "",
@@ -16,7 +16,9 @@
16
16
  },
17
17
  "files": [
18
18
  "dist",
19
- "src"
19
+ "src",
20
+ "rules",
21
+ "skills"
20
22
  ],
21
23
  "publishConfig": {
22
24
  "access": "public"
@@ -35,5 +37,5 @@
35
37
  "react-dom": "^19.2.1",
36
38
  "react-router": "^7.10.1"
37
39
  },
38
- "gitHead": "6ee79f3d678fc5a42dcc24dec742c2ab129cea45"
40
+ "gitHead": "bb8bb09df420bd823e210e09cf45a4bd8a4c4922"
39
41
  }
@@ -0,0 +1,32 @@
1
+ ---
2
+ paths:
3
+ - "**/*.tsx"
4
+ - "**/components/**/*.ts"
5
+ ---
6
+
7
+ # Agentforce Conversation Client (standards)
8
+
9
+ When adding or editing the embedded Agentforce chat client in this project, follow these conventions.
10
+
11
+ ## Component and library
12
+
13
+ - Use the shared **AgentforceConversationClient** React component from `feature-react-agentforce-conversation-client`. Do not call `embedAgentforceClient` directly in application code.
14
+ - The project must have **@salesforce/agentforce-conversation-client** installed (`npm install @salesforce/agentforce-conversation-client`).
15
+
16
+ ## Authentication
17
+
18
+ - The component resolves auth automatically: **localhost** fetches `frontdoorUrl` from `/__lo/frontdoor`; **production** uses `window.location.origin` as `salesforceOrigin`.
19
+ - Do not hard-code `salesforceOrigin` or `frontdoorUrl` unless the consumer explicitly provides them as props.
20
+
21
+ ## Rendering mode
22
+
23
+ - Pass `agentforceClientConfig.renderingConfig.mode` to select **floating** (default) or **inline**. Do not apply custom positioning CSS to override the built-in layout.
24
+ - For inline mode, set `width` and `height` in `renderingConfig`. Do not override iframe dimensions with external CSS.
25
+
26
+ ## Agent selection
27
+
28
+ - Use `agentforceClientConfig.agentId` to select a specific agent. Ask the user for the agent ID; if not provided, note that the org's default agent is used.
29
+
30
+ ## Placement
31
+
32
+ - Render `<AgentforceConversationClient />` inside the existing app layout (e.g. alongside `<Outlet />`). Do not replace the entire page shell with the chat client.
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: embedded-agent
3
+ description: Embed an Agentforce conversation client (chat UI) into a React web application. Use when the user wants to add an employee agent, a chat client, chatbot, chat widget, chat component, conversation client, or conversational interface to their React app. Also applies when the user asks to embed or integrate any Salesforce agent — including employee agent, travel agent, HR agent, service agent, or any custom-named agent — or mentions Agentforce, Agentforce widget, Agentforce chat, or agent chat.
4
+ ---
5
+
6
+ # Embedded Agentforce chat (workflow)
7
+
8
+ When the user wants an embedded Agentforce chat client in a React app, follow this workflow.
9
+
10
+ ## 1. Install the dependency
11
+
12
+ ```bash
13
+ npm install @salesforce/agentforce-conversation-client
14
+ ```
15
+
16
+ The dependency should be added to the project's `package.json` dependencies.
17
+
18
+ ## 2. Add the feature
19
+
20
+ - Include `@salesforce/webapp-template-feature-react-agentforce-conversation-client-experimental` in the app configuration.
21
+ - This feature provides **AgentforceConversationClient**.
22
+
23
+ ## 3. Use the shared wrapper
24
+
25
+ Use the `AgentforceConversationClient` React component. It resolves auth automatically:
26
+
27
+ - **Dev (localhost)**: fetches `frontdoorUrl` from `/__lo/frontdoor`
28
+ - **Prod (hosted in org)**: uses `salesforceOrigin` from `window.location.origin`
29
+
30
+ ## 4. Embed in the layout
31
+
32
+ Render `<AgentforceConversationClient />` in the app layout so the chat client loads globally. Keep it alongside the existing layout (do not replace the page shell).
33
+
34
+ ```tsx
35
+ import { Outlet } from "react-router";
36
+ import { AgentforceConversationClient } from "@salesforce/webapp-template-feature-react-agentforce-conversation-client-experimental";
37
+
38
+ export default function AppLayout() {
39
+ return (
40
+ <>
41
+ <Outlet />
42
+ <AgentforceConversationClient />
43
+ </>
44
+ );
45
+ }
46
+ ```
47
+
48
+ ## 5. Configure the agent
49
+
50
+ Pass options via the `agentforceClientConfig` prop:
51
+
52
+ | Option | Purpose |
53
+ | ---------------------------------- | ------------------------------------------------- |
54
+ | `renderingConfig.mode` | `"floating"` (default) or `"inline"` |
55
+ | `renderingConfig.width` / `height` | Inline dimensions (number for px, string for CSS) |
56
+ | `agentId` | Select a specific agent from the org |
57
+ | `styleTokens` | Theme colors and style overrides |
58
+
59
+ See [embed-examples.md](docs/embed-examples.md) for complete examples of each mode.
60
+
61
+ ## 6. Validate prerequisites
62
+
63
+ - The org must allow `localhost:<PORT>` in **Trusted Domains for Inline Frames** (session settings).
64
+
65
+ ## Quick reference: rendering modes
66
+
67
+ ### Floating (default)
68
+
69
+ A persistent chat widget overlay pinned to the bottom-right corner. No extra config needed — floating is the default.
70
+
71
+ ```tsx
72
+ <AgentforceConversationClient />
73
+ ```
74
+
75
+ ### Inline
76
+
77
+ The chat renders within the page layout at a specific size.
78
+
79
+ ```tsx
80
+ <AgentforceConversationClient
81
+ agentforceClientConfig={{
82
+ renderingConfig: { mode: "inline", width: 420, height: 600 },
83
+ }}
84
+ />
85
+ ```
86
+
87
+ ### Theming
88
+
89
+ Use `styleTokens` to customize the chat appearance.
90
+
91
+ ```tsx
92
+ <AgentforceConversationClient
93
+ agentforceClientConfig={{
94
+ styleTokens: {
95
+ headerBlockBackground: "#0176d3",
96
+ headerBlockTextColor: "#ffffff",
97
+ messageBlockInboundColor: "#0176d3",
98
+ },
99
+ }}
100
+ />
101
+ ```
102
+
103
+ ### Agent selection
104
+
105
+ Pass `agentId` to load a specific agent (e.g. travel agent, HR agent).
106
+
107
+ ```tsx
108
+ <AgentforceConversationClient
109
+ agentforceClientConfig={{
110
+ agentId: "0Xx000000000000",
111
+ }}
112
+ />
113
+ ```
@@ -0,0 +1,182 @@
1
+ # Embed examples
2
+
3
+ Detailed examples for configuring the Agentforce Conversation Client. All examples use the `AgentforceConversationClient` React component; the underlying `embedAgentforceClient` API accepts the same `agentforceClientConfig` shape.
4
+
5
+ ---
6
+
7
+ ## Floating mode (default)
8
+
9
+ A floating chat widget appears in the bottom-right corner. It starts minimized and expands when the user clicks it. This is the default — no `renderingConfig` is required.
10
+
11
+ ### Minimal (no config)
12
+
13
+ ```tsx
14
+ <AgentforceConversationClient />
15
+ ```
16
+
17
+ ### Explicit floating
18
+
19
+ ```tsx
20
+ <AgentforceConversationClient
21
+ agentforceClientConfig={{
22
+ renderingConfig: { mode: "floating" },
23
+ }}
24
+ />
25
+ ```
26
+
27
+ ### Floating with a specific agent and theme
28
+
29
+ ```tsx
30
+ <AgentforceConversationClient
31
+ agentforceClientConfig={{
32
+ renderingConfig: { mode: "floating" },
33
+ agentId: "0Xx000000000000",
34
+ styleTokens: {
35
+ headerBlockBackground: "#032D60",
36
+ headerBlockTextColor: "#ffffff",
37
+ },
38
+ }}
39
+ />
40
+ ```
41
+
42
+ ---
43
+
44
+ ## Inline mode
45
+
46
+ The chat renders inside the parent container at a specific size. Use this when the chat should be part of the page layout rather than an overlay.
47
+
48
+ ### Fixed pixel dimensions
49
+
50
+ ```tsx
51
+ <AgentforceConversationClient
52
+ agentforceClientConfig={{
53
+ renderingConfig: { mode: "inline", width: 420, height: 600 },
54
+ }}
55
+ />
56
+ ```
57
+
58
+ ### CSS string dimensions
59
+
60
+ ```tsx
61
+ <AgentforceConversationClient
62
+ agentforceClientConfig={{
63
+ renderingConfig: { mode: "inline", width: "100%", height: "80vh" },
64
+ }}
65
+ />
66
+ ```
67
+
68
+ ### Inline filling a sidebar
69
+
70
+ ```tsx
71
+ <div style={{ display: "flex", height: "100vh" }}>
72
+ <main style={{ flex: 1 }}>{/* App content */}</main>
73
+ <aside style={{ width: 400 }}>
74
+ <AgentforceConversationClient
75
+ agentforceClientConfig={{
76
+ renderingConfig: { mode: "inline", width: "100%", height: "100%" },
77
+ }}
78
+ />
79
+ </aside>
80
+ </div>
81
+ ```
82
+
83
+ ---
84
+
85
+ ## Theming
86
+
87
+ Use `styleTokens` to customize colors. Tokens are passed directly to the Agentforce client.
88
+
89
+ ### Brand-colored header
90
+
91
+ ```tsx
92
+ <AgentforceConversationClient
93
+ agentforceClientConfig={{
94
+ styleTokens: {
95
+ headerBlockBackground: "#0176d3",
96
+ headerBlockTextColor: "#ffffff",
97
+ },
98
+ }}
99
+ />
100
+ ```
101
+
102
+ ### Full theme example
103
+
104
+ ```tsx
105
+ <AgentforceConversationClient
106
+ agentforceClientConfig={{
107
+ styleTokens: {
108
+ headerBlockBackground: "#0176d3",
109
+ headerBlockTextColor: "#ffffff",
110
+ messageBlockInboundColor: "#0176d3",
111
+ },
112
+ }}
113
+ />
114
+ ```
115
+
116
+ ### Dark theme example
117
+
118
+ ```tsx
119
+ <AgentforceConversationClient
120
+ agentforceClientConfig={{
121
+ styleTokens: {
122
+ headerBlockBackground: "#1a1a2e",
123
+ headerBlockTextColor: "#e0e0e0",
124
+ messageBlockInboundColor: "#16213e",
125
+ },
126
+ }}
127
+ />
128
+ ```
129
+
130
+ ---
131
+
132
+ ## Agent selection
133
+
134
+ Use `agentId` to load a specific agent from the org. If omitted, the org's default employee agent is used.
135
+
136
+ ### Specific agent by ID
137
+
138
+ ```tsx
139
+ <AgentforceConversationClient
140
+ agentforceClientConfig={{
141
+ agentId: "0Xx000000000000",
142
+ }}
143
+ />
144
+ ```
145
+
146
+ ### Agent with inline mode and theming
147
+
148
+ ```tsx
149
+ <AgentforceConversationClient
150
+ agentforceClientConfig={{
151
+ agentId: "0Xx000000000000",
152
+ renderingConfig: { mode: "inline", width: 400, height: 700 },
153
+ styleTokens: {
154
+ headerBlockBackground: "#0176d3",
155
+ headerBlockTextColor: "#ffffff",
156
+ },
157
+ }}
158
+ />
159
+ ```
160
+
161
+ ---
162
+
163
+ ## Using the low-level `embedAgentforceClient` API
164
+
165
+ The React component wraps `embedAgentforceClient`. If you need the raw API (e.g. in a non-React context), the config shape is the same:
166
+
167
+ ```ts
168
+ import { embedAgentforceClient } from "@salesforce/agentforce-conversation-client";
169
+
170
+ const { loApp, chatClientComponent } = embedAgentforceClient({
171
+ container: "#agentforce-container",
172
+ salesforceOrigin: "https://myorg.my.salesforce.com",
173
+ agentforceClientConfig: {
174
+ agentId: "0Xx000000000000",
175
+ renderingConfig: { mode: "floating" },
176
+ styleTokens: {
177
+ headerBlockBackground: "#0176d3",
178
+ headerBlockTextColor: "#ffffff",
179
+ },
180
+ },
181
+ });
182
+ ```