
Implementing Ui Bundle Agentforce Conversation Client
- 2.1k installs
- 763 repo stars
- Updated July 24, 2026
- forcedotcom/sf-skills
implementing-ui-bundle-agentforce-conversation-client embeds AgentforceConversationClient in UI Bundle React projects.
About
This skill embeds the Salesforce Agentforce Conversation Client in UI Bundle projects that contain uiBundles/*/src directories. A hard constraint forbids creating custom chatbot components; all requests must use AgentforceConversationClient from @salesforce/ui-bundle-template-feature-react-agentforce-conversation-client. Step one greps for existing usage excluding implementation files and validates agentId against ^0Xx[a-zA-Z0-9]{15}$. Step two resolves agent IDs via sf CLI SOQL for Employee Agents, handling missing CLI, unauthenticated orgs, inactive agents, and user selection without auto-pick. Step three defines canonical imports. Local development requires trusted domain localhost:5173 in Session Settings with a warning to remove before production. Prerequisites include user-configured Salesforce settings the skill calls out after embedding. Custom agent builds and projects without uiBundles are explicit do-not-trigger cases. Projects without uiBundles never trigger this skill. See SKILL.md for the authoritative workflow and constraints. Step four applies the embed or update in the target React file.
- Hard ban on custom chat widgets; only AgentforceConversationClient.
- agentId must match ^0Xx[a-zA-Z0-9]{15}$ or be resolved via SOQL.
- sf CLI queries Employee Agents; never auto-select without user confirm.
- Trusted localhost domain required for local dev; remove before prod.
- Detects existing embeds and offers prop updates versus fresh install.
Implementing Ui Bundle Agentforce Conversation Client by the numbers
- 2,085 all-time installs (skills.sh)
- +7 installs in the week ending Jul 28, 2026 (Skillselion tracking)
- Ranked #220 of 2,277 Frontend Development skills by installs in the Skillselion catalog
- Security screen: HIGH risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
implementing-ui-bundle-agentforce-conversation-client capabilities & compatibility
- Capabilities
- existing embed detection and agentid validation · sf cli employee agent soql resolution · canonical import path for conversation client · local trusted domain prerequisite callouts · prop update versus fresh embed decision tree
- Use cases
- frontend · api development
What implementing-ui-bundle-agentforce-conversation-client says it does
NEVER create a custom agent, chatbot, or chat widget component.
One agent → still confirm with user, do not auto-select.
npx skills add https://github.com/forcedotcom/sf-skills --skill implementing-ui-bundle-agentforce-conversation-clientAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 2.1k |
|---|---|
| repo stars | ★ 763 |
| Security audit | 2 / 3 scanners passed |
| Last updated | July 24, 2026 |
| Repository | forcedotcom/sf-skills ↗ |
How do I add Agentforce chat to my UI Bundle app with a valid agent ID?
Embed AgentforceConversationClient in UI Bundle projects; resolve agent IDs via SF CLI and never build custom chat widgets.
Who is it for?
UI Bundle projects needing the standard Agentforce chat widget, not custom chat UIs.
Skip if: Skip for custom chatbot builds or repos without a uiBundles directory.
When should I use this skill?
User adds chat widget, Agentforce client, or AgentforceConversationClient in a UI Bundle project.
What you get
Embedded conversation client with validated agentId and documented Salesforce prerequisites.
- Resolved BotDefinition Id
- SOQL query result JSON
- React client agent ID wiring
Files
Managing Agentforce Conversation Client
HARD CONSTRAINT: NEVER create a custom agent, chatbot, or chat widget component. ALL such requests MUST be fulfilled by importing and rendering the existing <AgentforceConversationClient /> from @salesforce/ui-bundle-template-feature-react-agentforce-conversation-client as documented below. If a requirement is unsupported by this component's props, state the limitation — do not improvise an alternative.
Prerequisites
Before the component will work, the following Salesforce settings must be configured by the user. ALWAYS call out the prequisites after successfully embedding the agent.
Trusted domains (required only for local development):
- Setup → Session Settings → Trusted Domains for Inline Frames → Add your domain
- Local development:
localhost:5173(default Vite dev server port) - Warning: Remove this trusted domain entry before deploying to production.
Instructions
Step 1: Check if component already exists
Search for existing usage across all app files (not implementation files):
grep -r "AgentforceConversationClient" --include="*.tsx" --include="*.jsx" --exclude-dir=node_modulesImportant: Look for React files that import and USE the component (for example, shared shells, route components, or feature pages). Do NOT open files named AgentforceConversationClient.tsx or AgentforceConversationClient.jsx - those are the component implementation.
If multiple files found: Ask the user which component file they are referring to. Do not proceed until clarified.
If found: Read the file and check the current agentId value.
Agent ID validation rule (deterministic):
- Valid only if it matches:
^0Xx[a-zA-Z0-9]{15}$ - Meaning: starts with
0Xxand total length is 18 characters
Decision:
- If
agentIdmatches^0Xx[a-zA-Z0-9]{15}$and user wants to update other props → Go to Step 4 (update props) - If
agentIdmatches^0Xx[a-zA-Z0-9]{15}$and user asks to "embed" or "add" the chat client → Inform: "The Agentforce Conversation Client is already embedded in<file>with agent ID<agentId>. Would you like to change the agent or update other props?" - Change agent → Step 2
- Update props → Step 4b
- If
agentIdis missing, empty, or does NOT match^0Xx[a-zA-Z0-9]{15}$→ Continue to Step 2 (need real ID) - If not found → Continue to Step 2 (add new)
If user reports an error:
If the user says the component is "not working", "showing an error", or similar — ask them for the specific error message. Then proceed to Step 2 to cross-check the configured agentId against the org.
Step 2: Resolve and Validate Agent ID
Prerequisites
1. Verify sf CLI is available:
sf --versionIf fails:
- Inform: "The Salesforce CLI (
sf) is not installed. It's needed to query available agents from your org." - Ask: "Would you like me to install it?"
- Yes → Install via
npm install -g @salesforce/cli, then continue. - No → "You can find your agent ID manually in Setup → Agentforce Agents → click the agent name → copy the ID from the URL. Would you like to provide it now, or skip this step?"
- User provides ID → validate format (
^0Xx[a-zA-Z0-9]{15}$), store it, proceed to Step 3. - Skip → proceed to Step 4 with placeholder
<YOUR_AGENT_ID>.
2. Verify org connectivity:
sf org display --jsonIf fails:
- Inform: "No authenticated org found."
- Ask: "Would you like to connect to your org now? Run
sf org login webto authenticate." - User authenticates → retry the query, continue.
- User declines → "You can find your agent ID manually in Setup → Agentforce Agents → click the agent name → copy the ID from the URL. Would you like to provide it now, or skip this step?"
- User provides ID → validate format, store it, proceed to Step 3.
- Skip → proceed to Step 4 with placeholder
<YOUR_AGENT_ID>.
Note: Even if the user provides their own agentId, the org must be connected for the agent to function at runtime. An agentId without a connected org will not work.
Query all Employee Agents
Run the SOQL query defined in references/agent-id-resolution.md.
Handle results
No records at all:
"No Employee Agents found in this org. Create one in Setup → Agentforce Agents."
Ask user if they want to provide an agent ID manually or skip. If skip, proceed to Step 4 with placeholder <YOUR_AGENT_ID>.
All agents are inactive:
Found Employee Agents but none are active:
- Agentforce Sales Agent (0Xxxx000000001dCAA)
- HR Assistant (0Xxxx0000000002BBB)
>
To activate: Setup → Agentforce Agents → click the agent name → open in Agent Builder → press Activate.
Then re-run this step.
Ask user if they want to provide an agent ID manually or skip. If skip, proceed to Step 4 with placeholder <YOUR_AGENT_ID>.
Has active agents — Path A (fresh install / no existing agentId):
Present only active agents for selection:
Which agent should the chat widget use?
1. Property Manager Agent (0Xxxx0000000001CAA)
2. HR Assistant (0Xxxx0000000002BBB)
- One agent → still confirm with user, do not auto-select.
- If user picks one → store the selected
Idfor use in Step 4. - If user declines to pick ("skip", "no", "I don't want to set one") → accept it and move to next steps. Do not re-ask. In Step 4, use placeholder
<YOUR_AGENT_ID>for fresh installs. For existing projects, leave the component as-is.
Has active agents — Path B (existing agentId from Step 1, passed format check):
Cross-check the existing agentId against query results:
- ID found, agent is Active → "Agent ID maps to 'Property Manager Agent' — active in the org." Proceed.
- ID found, agent is Inactive → "The configured agent 'Sales Agent' exists but is Inactive. To activate: Setup → Agentforce Agents → click the agent name → open in Agent Builder → press Activate. Or pick a different active agent:" → show active list.
- ID not found at all → "The configured agent (0Xxxx...) doesn't exist in this org — it may have been deleted or belongs to a different org. Pick a replacement:" → show active list. If no active agents available, show inactive list with activation instructions.
If user reported an error → surface the agent name even if active, so user can confirm it's the intended one.
Query error handling
If the SOQL query fails, surface the error message from the response directly to the user. Do not guess at the fix — just report what came back. For example:
"The query failed with: [error message from response]. Check your org permissions or that the API version supports this object."What this step does NOT do
- No fallback to GraphQL or Tooling API — SOQL only
- No auto-selection (always confirm with user)
- No programmatic activation (only via Setup UI)
- No file writes (that's Step 4)
Step 3: Canonical import strategy
Use this import path by default in app code:
import { AgentforceConversationClient } from "@salesforce/ui-bundle-template-feature-react-agentforce-conversation-client";If the package is not installed, install it:
npm install @salesforce/ui-bundle-template-feature-react-agentforce-conversation-clientOnly use a local relative import (for example, ./components/AgentforceConversationClient) when the user explicitly asks to use a patched/local component in that app.
Do not infer import path from file discovery alone. Prefer one consistent package import across the codebase.
Step 4: Add or update component
Determine which sub-step applies:
- Component NOT found in Step 1 → go to 4a (New installation)
- Component found in Step 1 → go to 4b (Update existing)
4a — New installation
1. If the user already specified a target file, use that file. Otherwise, ask the user: _"Which file should I add the AgentforceConversationClient to?"_ Do NOT proceed until a target file is confirmed. 2. Read the target file to understand its existing imports and TSX structure. 3. Add the import at the top of the file, alongside existing imports. Use the canonical package import from Step 3:
import { AgentforceConversationClient } from "@salesforce/ui-bundle-template-feature-react-agentforce-conversation-client";4. Insert the <AgentforceConversationClient /> TSX into the component's return block. Place it as a sibling of existing content — do NOT wrap or restructure existing TSX. Use the real agentId obtained in Step 2. If no agentId was resolved (user skipped Step 2), use the placeholder:
With resolved agentId:
<AgentforceConversationClient agentId="0Xx8X00000001AbCDE" />Without resolved agentId (user skipped):
<AgentforceConversationClient agentId="<YOUR_AGENT_ID>" />5. Do NOT add any other code (wrappers, layout components, new functions) unless the user explicitly requests it.
4b — Update existing
1. Read the file identified in Step 1. 2. Locate the existing <AgentforceConversationClient ... /> TSX element. 3. Apply only the changes the user requested. Rules:
- Add new props that the user asked for.
- Change prop values the user asked to update.
- Preserve every prop and value the user did NOT mention — do not remove, reorder, or reformat them.
- Never delete the component and recreate it.
4. If Step 2 was triggered (cross-check or fresh selection) and a new agent ID was resolved, replace the existing agentId value with the new one. 5. If the current agentId is already valid and the user did not ask to change it and Step 2 confirmed it is active, leave it as-is.
Post-Step-4 error handling
If the user reports an error after the component has been set up (e.g., "it's not working", "I see an error"), go to Step 2 to validate the configured agentId against the org. Cross-check whether the agent is active, exists, and belongs to the connected org.
Step 5: Configure props
Available props (use directly on component):
agentId(string, required) - Salesforce agent IDinline(boolean) -truefor inline mode, omit for floatingwidth(number | string) - e.g.,420or"100%"height(number | string) - e.g.,600or"80vh"headerEnabled(boolean) - Show/hide headerstyleTokens(object) - For all styling (colors, fonts, spacing)salesforceOrigin(string) - Auto-resolvedfrontdoorUrl(string) - Auto-resolvedagentLabel(string) - header title for agent
Examples:
Floating mode (default):
<AgentforceConversationClient agentId="0Xx..." />Inline mode with dimensions:
<AgentforceConversationClient agentId="0Xx..." inline width="420px" height="600px" />Adding or updating agent label:
<AgentforceConversationClient agentId="0Xx..." agentLabel="<dummy-agent-label>" />Styling rules (mandatory):
- ALL visual customization (colors, fonts, spacing, borders, radii, shadows) MUST go through the
styleTokensprop. There are no exceptions. - ONLY use token names listed in the tables below. Do NOT invent custom token names.
- NEVER apply styling via CSS files,
styleattributes,className, or wrapper elements. These approaches will not work and will be ignored by the component. - If the user requests a visual change that does not map to a token below, inform them that the change is not supported by the current token set.
For the complete list of available style tokens, consult references/style-tokens.md.
For complex patterns, consult references/examples.md for:
- Sidebar containers and responsive sizing
- Dark theme and advanced theming combinations
- Inline without header, calculated dimensions
- Complete host component examples
Common mistakes to avoid: Consult references/constraints.md for:
- Invalid props (containerStyle, style, className)
- Invalid styling approaches (CSS files, style tags)
- What files NOT to edit (implementation files)
Common Issues
If component doesn't appear or authentication fails, see references/troubleshooting.md for:
- Agent activation and deployment
- Localhost trusted domains
- Cookie restriction settings
Reference File Index
| File | When to read |
|---|---|
references/agent-id-resolution.md | Step 2 — SOQL query structure, response format, activation path, manual lookup |
references/style-tokens.md | Step 5 — Complete style token reference for all UI areas |
references/examples.md | Step 5 — Layout patterns, sizing, theming combinations, host component examples |
references/constraints.md | Step 4 — Invalid props, invalid styling approaches, files not to edit |
references/troubleshooting.md | Post-setup — Agent activation, trusted domains, cookie settings |
Agent ID Resolution
SOQL Query
sf data query \
--query "SELECT BotDefinition.Id, BotDefinition.DeveloperName, BotDefinition.MasterLabel, Status FROM BotVersion WHERE BotDefinition.AgentType = 'AgentforceEmployeeAgent' ORDER BY BotDefinition.CreatedDate ASC" \
--json- Queries
BotVersion(notBotDefinition) because onlyBotVersionhas theStatusfield (Active/Inactive) - Filters on
AgentType = 'AgentforceEmployeeAgent'to return only Employee Agents (excludes Service Agents)
Response Structure
{
"status": 0,
"result": {
"records": [
{
"BotDefinition": {
"Id": "0Xxxx0000000001CAA",
"DeveloperName": "Property_Manager_Agent",
"MasterLabel": "Property Manager Agent"
},
"Status": "Active"
}
]
}
}Activation Path
Agents cannot be activated programmatically:
Setup → Agentforce Agents → click agent name → Agent Builder → Activate
Manual Lookup (without sf CLI)
Setup → Agentforce Agents → click agent name → copy ID from URL
Validation
agentId must match: ^0Xx[a-zA-Z0-9]{15}$
Constraints and Anti-Patterns
This document lists all invalid approaches and patterns to avoid when working with AgentforceConversationClient.
Never Edit Implementation Files
CRITICAL: Only edit files where the component is USED, never the component implementation itself.
- ✅ DO edit: Any React files that import and use
<AgentforceConversationClient />(for example, shared shells, route components, or feature pages) - ❌ DO NOT edit: AgentforceConversationClient.tsx, AgentforceConversationClient.jsx, index.tsx, index.jsx, or any files inside:
node_modules/@salesforce/ui-bundle-template-feature-react-agentforce-conversation-client/src/packages/template/feature/feature-react-agentforce-conversation-client/src/src/components/AgentforceConversationClient.tsx(patched templates)- Any path containing
/components/AgentforceConversationClient.
If you're reading a file named `AgentforceConversationClient.tsx`, you're in the wrong place. Stop and search for the USAGE instead.
Invalid Props
AgentforceConversationClient uses a flat prop API and does NOT accept these props:
- ❌
containerStyle- Usewidthandheightprops directly instead - ❌
style- UsestyleTokensfor theming - ❌
className- Not supported - ❌ Any standard React div props - This wraps an embedded iframe, not a div
Why: The component is a wrapper around an embedded iframe using Lightning Out 2.0. Standard React styling props don't apply.
Invalid Styling Approaches
CRITICAL: For ALL styling, theming, branding, or color changes - ONLY use `styleTokens` prop.
Never use these approaches:
- ❌ Creating CSS files (e.g.,
agent-styles.css,theme.css) - ❌ Creating
<style>tags or internal stylesheets - ❌ Using
styleattribute on the component - ❌ Using
classNameprop - ❌ Inline styles
- ❌ CSS modules
- ❌ Styled-components or any CSS-in-JS libraries
Why: The component controls its own internal styling through the styleTokens API. External CSS cannot reach into the embedded iframe.
Invalid Implementation Approaches
Never do these:
- ❌ Create custom chat UIs from scratch
- ❌ Use third-party chat libraries (socket.io, WebSocket libraries, etc.)
- ❌ Call
embedAgentforceClientdirectly from@salesforce/agentforce-conversation-client - ❌ Build custom WebSocket or REST API chat implementations
Why: The AgentforceConversationClient component is the official wrapper that handles authentication, Lightning Out 2.0 initialization, and all communication with Salesforce agents. Custom implementations will not work.
Invalid Update Patterns
When updating an existing component:
- ❌ Delete and recreate the component
- ❌ Remove all props and start over
- ❌ Copy the entire component to a new file
Why: This loses configuration, introduces errors, and creates unnecessary diffs. Always update props in place.
Examples
❌ Wrong - Using containerStyle
<AgentforceConversationClient agentId="0Xx..." containerStyle={{ width: 420, height: 600 }} />✅ Correct - Using width/height directly
<AgentforceConversationClient agentId="0Xx..." width="420px" height="600px" />❌ Wrong - Creating CSS file
/* agent-styles.css */
.agentforce-chat {
background: red;
color: white;
}import "./agent-styles.css";
<AgentforceConversationClient className="agentforce-chat" />;✅ Correct - Using styleTokens
<AgentforceConversationClient
agentId="0Xx..."
styleTokens={{
headerBlockBackground: "red",
headerBlockTextColor: "white",
}}
/>❌ Wrong - Creating style tag
<>
<style>{`.agent-chat { background: blue; }`}</style>
<AgentforceConversationClient agentId="0Xx..." />
</>✅ Correct - Using styleTokens
<AgentforceConversationClient
agentId="0Xx..."
styleTokens={{
headerBlockBackground: "blue",
}}
/>❌ Wrong - Editing implementation file
Reading or editing: node_modules/@salesforce/ui-bundle-template-feature-react-agentforce-conversation-client/src/AgentforceConversationClient.tsx
✅ Correct - Editing usage file
Reading and editing: usage files where the component is imported and used (for example, src/app.tsx, a route component, or a feature page)
Additional Examples
Essential examples for common patterns and combinations. All use flat props API.
---
Layout Patterns
Sidebar Chat
export default function DashboardWithChat() {
return (
<div style={{ display: "flex", height: "100vh" }}>
<main style={{ flex: 1 }}>{/* Main content */}</main>
<aside style={{ width: 400 }}>
<AgentforceConversationClient agentId="0Xx..." inline width="100%" height="100%" />
</aside>
</div>
);
}Full Page Chat
export default function SupportPage() {
return (
<div>
<h1>Customer Support</h1>
<AgentforceConversationClient agentId="0Xx..." inline width="100%" height="600px" />
</div>
);
}---
Size Variations
Responsive sizing
<AgentforceConversationClient agentId="0Xx..." inline width="100%" height="80vh" />Calculated dimensions
<AgentforceConversationClient agentId="0Xx..." inline width="500px" height="calc(100vh - 100px)" />---
Theming Combinations
Brand theme with custom sizing
<AgentforceConversationClient
agentId="0Xx..."
inline
width="500px"
height="700px"
styleTokens={{
headerBlockBackground: "#0176d3",
headerBlockTextColor: "#ffffff",
messageBlockInboundBackgroundColor: "#0176d3",
messageBlockInboundTextColor: "#ffffff",
messageInputFooterSendButton: "#0176d3",
}}
/>Dark theme
<AgentforceConversationClient
agentId="0Xx..."
styleTokens={{
headerBlockBackground: "#1a1a1a",
headerBlockTextColor: "#ffffff",
messageBlockInboundBackgroundColor: "#2d2d2d",
messageBlockInboundTextColor: "#ffffff",
messageBlockOutboundBackgroundColor: "#3a3a3a",
messageBlockOutboundTextColor: "#f0f0f0",
}}
/>Inline without header
<AgentforceConversationClient
agentId="0Xx..."
inline
width="100%"
height="600px"
headerEnabled={false}
styleTokens={{
messageBlockBorderRadius: "12px",
}}
/>---
Complete Host Component Example
import { Outlet } from "react-router";
import { AgentforceConversationClient } from "@salesforce/ui-bundle-template-feature-react-agentforce-conversation-client";
export default function AgentChatHost() {
return (
<>
<Outlet />
<AgentforceConversationClient
agentId="0Xx..."
styleTokens={{
headerBlockBackground: "#0176d3",
headerBlockTextColor: "#ffffff",
}}
/>
</>
);
}---
For complete style token reference, see references/style-tokens.md or node_modules/@salesforce/agentforce-conversation-client/README.md.
Style Tokens Reference
This document explains how to use styleTokens for theming and styling the AgentforceConversationClient.
Overview
The styleTokens prop is the ONLY way to customize the appearance of the Agentforce conversation client. It accepts an object with style token keys and CSS values.
Source of Truth
For the complete and always up-to-date list of all style tokens, see the tables below:
- ALL visual customization (colors, fonts, spacing, borders, radii, shadows) MUST go through the
styleTokensprop. There are no exceptions. - ONLY use token names listed in the tables below. Do NOT invent custom token names.
- NEVER apply styling via CSS files,
styleattributes,className, or wrapper elements. These approaches will not work and will be ignored by the component. - If the user requests a visual change that does not map to a token below, inform them that the change is not supported by the current token set.
Container
| Token name | UI area themed |
|---|---|
fabBackground | FAB button background color |
fabForegroundColor | FAB button text color |
fabFontSize | FAB button text font size |
fabBorderRadius | FAB button border radius |
floatingButtonImage | FAB button custom icon image URL (img tag) |
floatingButtonImageAlt | FAB button custom icon image alt text |
floatingButtonLabel | FAB button label text |
containerBackground | Chat container background |
headerBackground | Header background |
containerWidth | Chat container width |
chatBorderRadius | Chat border radius |
layoutMaxWidth | Layout max width |
Agentforce Header
| Token name | UI area themed |
|---|---|
headerBlockBackground | Header block background |
headerImageUrl | Header custom icon image URL (img tag) |
headerImageAlt | Header custom icon image alt text |
headerBlockBorderBottomWidth | Header border bottom width |
headerBlockBorderBottomStyle | Header border bottom style |
headerBlockBorderBottomColor | Header border bottom color |
headerBlockBorderRadius | Header corner radius |
headerBlockPaddingBlock | Header block padding (vertical) |
headerBlockPaddingInline | Header inline padding (horizontal) |
headerBlockMinHeight | Header minimum height |
headerBlockBrandingGap | Header branding area gap |
headerBlockFontFamily | Header font family |
headerBlockFontWeight | Header title font weight |
headerBlockFontSize | Header title font size |
headerBlockLineHeight | Header title line height |
headerBlockTextColor | Header text color |
headerBlockIconDisplay | Header icon display |
headerBlockIconMargin | Header icon margin |
headerBlockIconColor | Header icon color |
headerBlockIconWidth | Header icon width |
headerBlockIconHeight | Header icon height |
headerBlockLogoMaxHeight | Header logo max height |
headerBlockLogoMaxWidth | Header logo max width |
headerBlockLogoMinWidth | Header logo min width |
headerBlockButtonHeight | Header action button height |
headerBlockButtonWidth | Header action button width |
headerBlockButtonPadding | Header action button padding |
headerBlockButtonBorderRadius | Header action button border radius |
headerBlockHoverBackground | Header hover background |
headerBlockActiveBackground | Header active background |
headerBlockFocusBorder | Header focus border |
Agentforce Welcome Block
| Token name | UI area themed |
|---|---|
welcomeBlockTextContainerWidth | Welcome text container width |
welcomeBlockFontFamily | Welcome block font family |
welcomeBlockFontSize | Welcome block font size |
welcomeBlockFontWeight | Welcome block font weight |
welcomeBlockLineHeight | Welcome block line height |
welcomeBlockLetterSpacing | Welcome block letter spacing |
welcomeBlockTextColor | Welcome block text color |
welcomeBlockPaddingVertical | Welcome block vertical padding |
welcomeBlockPaddingHorizontal | Welcome block horizontal padding |
welcomeBlockTextAnimationDuration | Welcome text animation duration |
Agentforce Messages
| Token name | UI area themed |
|---|---|
messageBlockBorderRadius | Message block border radius |
agentAvatarUrl | Agent avatar custom image URL (img tag) |
agentAvatarAltText | Agent avatar custom image alt text |
avatarDisplay | Avatar display property (e.g. block, none) |
hideMessageActions | Message actions display (e.g. block, none to hide) |
hideCopyAction | Copy action button display (e.g. inline-flex, none) |
messageBlockPaddingContainer | Message block container padding |
messageBlockFontSize | Message block font size |
messageBlockBackgroundColor | Message block background (base) |
messageBlockInboundBorder | Inbound message border |
messageBlockOutboundBorder | Outbound message border |
messageBlockBodyWidth | Message block body width |
messageBlockPadding | Message block padding |
messageBlockContainerMarginTop | Message block container top margin |
messageBlockLineHeight | Message block line height |
Avatar visibility (behavioral config)
Use renderingConfig.showAvatar to control whether avatars are rendered in message rows.
showAvatar: true(default) renders avatars.showAvatar: falsehides avatars by removing them from the DOM.
Inbound message (agent → customer)
| Token name | UI area themed |
|---|---|
inboundMessgeTextColor | Inbound message text color (base) |
messageBlockInboundBorderRadius | Inbound message border radius |
messageBlockInboundBackgroundColor | Inbound message background |
messageBlockInboundTextColor | Inbound message text color |
messageBlockInboundWidth | Inbound message width |
messageBlockInboundTextAlign | Inbound message text alignment |
messageBlockInboundHoverBackgroundColor | Inbound message hover background |
Outbound message (customer → agent)
| Token name | UI area themed |
|---|---|
messageBlockOutboundBorderRadius | Outbound message border radius |
messageBlockOutboundBackgroundColor | Outbound message background |
messageBlockOutboundTextColor | Outbound message text color |
messageBlockOutboundWidth | Outbound message width |
messageBlockOutboundMarginLeft | Outbound message left margin |
messageBlockOutboundTextAlign | Outbound message text alignment |
Agentforce Input
| Token name | UI area themed |
|---|---|
messageInputPadding | Message input container padding |
messageInputFooterBorderColor | Message input footer border color |
messageInputBorderRadius | Message input border radius |
messageInputBorderTransitionDuration | Message input border transition duration |
messageInputBorderTransitionEasing | Message input border transition easing |
messageInputTextColor | Message input text color |
messageInputTextBackgroundColor | Message input text background color |
messageInputFooterBorderFocusColor | Message input footer focus border color |
messageInputFocusShadow | Message input focus shadow |
messageInputMaxHeight | Message input max height |
messageInputLineHeight | Message input line height |
messageInputTextPadding | Message input text padding |
messageInputFontWeight | Message input font weight |
messageInputFontSize | Message input font size |
messageInputOverflowY | Message input overflow Y |
messageInputScrollbarWidth | Message input scrollbar width |
messageInputScrollbarColor | Message input scrollbar color |
messageInputActionsWidth | Message input actions width |
messageInputActionsPaddingRight | Message input actions right padding |
messageInputFooterPlaceholderTextColor | Message input placeholder text color |
messageInputPlaceholderFontWeight | Placeholder font weight |
messageInputErrorTextColor | Message input error text color |
messageInputActionsGap | Message input actions gap |
messageInputActionsPadding | Message input actions padding |
messageInputActionButtonSize | Message input action button size |
messageInputActionButtonRadius | Message input action button radius |
messageInputFooterSendButton | Message input send button color |
messageInputSendButtonDisabledColor | Message input send button disabled color |
messageInputActionButtonFocusBorder | Message input action button focus border |
messageInputActionButtonActiveIconColor | Message input action button active icon color |
messageInputActionButtonActiveBackground | Message input action button active background |
messageInputSendButtonIconColor | Message input send button icon color |
messageInputFooterSendButtonHoverColor | Message input send button hover color |
messageInputActionButtonHoverShadow | Message input action button hover shadow |
messageInputFilePreviewPadding | Message input file preview padding |
messageInputTextareaMaxHeight | Message input textarea max height |
messageInputTextareaWithImageMaxHeight | Message input textarea max height (with image) |
Agentforce Error Block
| Token name | UI area themed |
|---|---|
errorBlockBackground | Error block background color |
errorBlockIconColor | Error block icon color |
Token Categories
Style tokens are organized by UI area:
- Container/FAB : background, border radius, custom icon image (img tag), alt text
- Header : background, text color, hover, active, focus, border, font family, custom icon image (img tag), alt text
- Messages : colors, padding, margins, border radius, fonts, body width, custom agent avatar image (img tag), alt text
- Inbound messages : background, text color, width, alignment, hover
- Outbound messages : background, text color, width, alignment, margin
- Input : colors, borders, fonts, padding, buttons, scrollbar, textarea, actions
- Error Component : background
Common Use Cases
Change header color
<AgentforceConversationClient
agentId="0Xx..."
styleTokens={{
headerBlockBackground: "#0176d3",
headerBlockTextColor: "#ffffff",
}}
/>Change message colors
<AgentforceConversationClient
agentId="0Xx..."
styleTokens={{
messageBlockInboundBackgroundColor: "#4CAF50",
messageBlockInboundTextColor: "#ffffff",
messageBlockOutboundBackgroundColor: "#f5f5f5",
messageBlockOutboundTextColor: "#333333",
}}
/>Apply brand colors
<AgentforceConversationClient
agentId="0Xx..."
styleTokens={{
headerBlockBackground: "#1a73e8",
headerBlockTextColor: "#ffffff",
messageBlockInboundBackgroundColor: "#1a73e8",
messageBlockInboundTextColor: "#ffffff",
messageInputFooterSendButton: "#1a73e8",
messageInputFooterSendButtonHoverColor: "#1557b0",
}}
/>Adjust spacing and fonts
<AgentforceConversationClient
agentId="0Xx..."
styleTokens={{
messageInputFontSize: "16px",
messageBlockBorderRadius: "12px",
messageBlockPadding: "16px",
messageInputPadding: "12px",
}}
/>Important Notes
- You do NOT need to provide all tokens - only override the ones you want to change
- Token values are CSS strings (e.g.,
"#FF0000","16px","bold") - Invalid token names are silently ignored
- The component uses default values for any tokens you don't specify
Troubleshooting
Common issues when using the Agentforce Conversation Client.
---
Component throws "requires agentId"
Cause: agentId was not passed.
Solution: Pass agentId directly as a flat prop:
<AgentforceConversationClient agentId="0Xx000000000000AAA" />---
Chat widget does not appear
Cause: Invalid agentId or inactive agent.
Solution:
1. Confirm the id is correct (18-char Salesforce id, starts with 0Xx). 2. Ensure the agent is Active in Setup → Agentforce Agents. 3. Verify the agent is deployed to the target channel.
---
Authentication error on localhost
Cause: localhost:<PORT> is not trusted for inline frames.
Solution:
1. Go to Setup → Session Settings → Trusted Domains for Inline Frames. 2. Add localhost:<PORT> (example: localhost:3000).
Important:
- This setting should be temporary for local development only.
- Remove `localhost:<PORT>` from trusted domains after development.
- Recommended: Test the Agentforce conversation client in a deployed app instead of relying on localhost trusted domains for extended periods.
---
Blank iframe / auth session issues
Possible cause: First-party Salesforce cookie restriction may block embedded auth flow in some environments.
Solution:
1. Go to Setup → Session Settings. 2. Find Require first party use of Salesforce cookies. 3. Disable it only if needed and approved by your security/admin team. 4. Save and reload.
Related skills
Forks & variants (1)
Implementing Ui Bundle Agentforce Conversation Client has 1 known copy in the catalog totaling 1.5k installs. They canonicalize to this original listing.
- forcedotcom - 1.5k installs
How it compares
Use this skill for Employee Agent ID resolution in React UI bundles; use broader Salesforce skills when customizing Service Agent routing or Apex backends.
FAQ
Can I build a custom chat component?
No. Use AgentforceConversationClient only; state limitations if props are insufficient.
How is agentId validated?
Must match ^0Xx plus 15 alphanumeric chars, confirmed via SOQL Employee Agent query.
What local dev setup is required?
Add localhost:5173 to Trusted Domains for Inline Frames; remove before production deploy.
Is Implementing Ui Bundle Agentforce Conversation Client safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.