implementing-ui-bundle-agentforce-conversation-client

Embed and configure the Salesforce AgentforceConversationClient chat widget in React ui-bundle applications.

1|Updated May 7, 2026
One-click install
npx skills add https://github.com/amanpraaj/sf-skill-hub --skill implementing-ui-bundle-agentforce-conversation-client-amanpraaj
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: implementing-ui-bundle-agentforce-conversation-client
Source: https://github.com/amanpraaj/sf-skill-hub/tree/main/skills/salesforce/implementing-ui-bundle-agentforce-conversation-client
Command: npx skills add https://github.com/amanpraaj/sf-skill-hub --skill implementing-ui-bundle-agentforce-conversation-client-amanpraaj

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @salesforce/ui-bundle-template-feature-react-agentforce-conversation-client, @salesforce/agentforce-conversation-client, and includes references (resource) components.

What problem does it solve? Adding a Salesforce Agentforce chat agent to a React ui-bundle app involves strict rules: a canonical package import, a validated 18-character agent ID, and styling that only works through the styleTokens prop. This Skill enforces those rules so the chat widget renders and authenticates correctly instead of failing silently. ## Core Features & Use Cases - Deterministic add-or-update workflow: Detects existing AgentforceConversationClient usage, validates the agentId against the ^0Xx[a-zA-Z0-9]{15}$ pattern, and either installs the component or updates props in place without deleting existing configuration. - Token-based theming: Provides the complete styleTokens reference for header, messages, input, welcome, and error blocks, covering colors, fonts, spacing, borders, and layout dimensions. - Troubleshooting guidance: Resolves common failures such as missing agentId, inactive agents, localhost trusted-domain errors, and first-party cookie restrictions. - Use Case: A developer is asked to add a branded chatbot to a support page. The Skill installs the package, embeds <AgentforceConversationClient agentId="0Xx..." inline width="420px" />, applies brand colors via styleTokens, and lists the required Salesforce setup steps. ## Quick Start Ask the agent to add the Agentforce conversation client to a specific React file with your 18-character agent ID and any desired styling or layout props.

Frequently Asked Questions about implementing-ui-bundle-agentforce-conversation-client

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a Salesforce Agentforce chat widget to a React app?▼

Install @salesforce/ui-bundle-template-feature-react-agentforce-conversation-client, import AgentforceConversationClient, and render it with a valid agentId prop. Never build a custom chat component; the official wrapper handles authentication and Lightning Out 2.0 initialization.

How do I style the Agentforce conversation client colors and fonts?▼

All styling must go through the styleTokens prop using documented token names like headerBlockBackground or messageBlockInboundTextColor. CSS files, style attributes, className, and styled-components do not work because the component renders an embedded iframe.

What is a valid agentId for AgentforceConversationClient?▼

A valid agentId is an 18-character Salesforce ID matching ^0Xx[a-zA-Z0-9]{15}$, starting with 0Xx. Placeholder values like "YOUR_AGENT_ID" or "0Xx..." are treated as invalid and must be replaced with the real ID.

Why is the Agentforce chat widget not appearing on localhost?▼

The widget fails on localhost when the domain is not trusted for inline frames. Add localhost:<PORT> under Setup → Session Settings → Trusted Domains for Inline Frames, and confirm the agent is active and deployed in Setup → Agentforce Agents.

Can I use containerStyle or className props on AgentforceConversationClient?▼

No. The component uses a flat prop API and does not accept containerStyle, style, className, or standard div props. Use width and height props for dimensions and styleTokens for all theming.