Type Alias: AgentContextConfig

AgentContextConfig: object

Defines the context configuration for an AnalyticsAgent component.

Both contextType and contextTypeIdOrApiName must be provided together. When provided as contextConfig in AgentProps, the agent runs in single-context mode and tracks only the specified component. When contextConfig is omitted from AgentProps, the agent runs in multi-component mode and automatically tracks all embedded analytics components on the page.

Type declaration 

contextType 

contextType: AgentContextType

Required. The type of the asset to configure the agent for. Must be a valid AgentContextType enum value (SDM, METRIC, or DASHBOARD).

contextTypeIdOrApiName 

contextTypeIdOrApiName: string

Required. The unique ID or API name of the asset to configure the agent for. This must reference an asset that exists in the same org as the agent.

Example 

1import { AgentContextType } from "@salesforce/analytics-embedding-sdk";
2import type { AgentContextConfig } from "@salesforce/analytics-embedding-sdk";
3
4const contextConfig: AgentContextConfig = {
5  contextType: AgentContextType.DASHBOARD,
6  contextTypeIdOrApiName: "My_Dashboard_1",
7};

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!