mirror of
https://github.com/forcedotcom/afv-library.git
synced 2026-07-30 11:43:26 +08:00
1.6 KiB
1.6 KiB
| paths | ||
|---|---|---|
|
Agentforce Conversation Client (standards)
When adding or editing the embedded Agentforce chat client in this project, follow these conventions.
Component and library
- Use the shared AgentforceConversationClient React component from
@salesforce/webapp-template-feature-react-agentforce-conversation-client-experimental. Do not callembedAgentforceClientdirectly in application code. - Install with
npm install @salesforce/webapp-template-feature-react-agentforce-conversation-client-experimental. The underlying SDK (@salesforce/agentforce-conversation-client) is included automatically as a dependency.
Authentication
- The component resolves auth automatically: localhost fetches
frontdoorUrlfrom/__lo/frontdoor; production useswindow.location.originassalesforceOrigin. - Do not hard-code
salesforceOriginorfrontdoorUrlunless the consumer explicitly provides them as props.
Rendering mode
- Pass
agentforceClientConfig.renderingConfig.modeto select floating (default) or inline. Do not apply custom positioning CSS to override the built-in layout. - For inline mode, set
widthandheightinrenderingConfig. Do not override iframe dimensions with external CSS.
Agent selection
- Use
agentforceClientConfig.agentIdto select a specific agent. Ask the user for the agent ID; if not provided, note that the org's default agent is used.
Placement
- Render
<AgentforceConversationClient />inside the existing app layout (e.g. alongside<Outlet />). Do not replace the entire page shell with the chat client.