Type Alias: AgentProps

AgentProps: Omit<ComponentProps, "filters"> & object

Defines the properties for creating an AnalyticsAgent component.

The agent supports two operating modes:

  • Single-context mode: Provide contextConfig to track a single analytics asset.
  • Multi-component mode: Omit contextConfig to automatically track all embedded AnalyticsDashboard and AnalyticsMetric components on the page.

Multi-org Note: In multi-org scenarios, always specify the orgUrl property to indicate which org the agent exists in. The orgUrl must be a Lightning URL (e.g., https://yourorg.lightning.force.com).

optional agentName: string

The custom display name for the agent. The default name is 'Analytics and Visualization'.

optional contextConfig: AgentContextConfig

Optional. The context configuration for the agent. When provided, the agent runs in single-context mode and tracks only the specified component. When omitted, the agent runs in multi-component mode and automatically tracks all embedded AnalyticsDashboard and AnalyticsMetric components on the page.

idOrApiName: string

Required. The ID of the Agentforce agent to embed.

optional showHeader: boolean

A boolean value indicating whether to display the agent's header section or not. The default value is false.

optional showHeaderActions: boolean

A boolean value indicating whether to display the agent's header actions, information and restart session, or not. The default value is false.

optional styleTokens: AgentStyleTokens

The style tokens for theming the agent UI. See AgentStyleTokens for available tokens.

optional welcomeText: string

The initial welcome message displayed before the user sends a message.