AgentforceConnectionInfo

Overview 

Structure that encapsulates connection information for Agentforce services, including the service API URL and tenant identifier. This information is used to route requests to the appropriate Agentforce service endpoints.

Declaration 

1struct AgentforceConnectionInfo: Codable

Properties 

PropertyTypeDescription
sfapURLStringThe Salesforce API Platform (SFAP) URL used for Agentforce service communication.
tenantIdStringThe tenant identifier that uniquely identifies the Salesforce organization’s Agentforce service instance.

Methods 

MethodSignatureDescription
initinit(sfapURL:tenantId:)Creates a connection info instance with the specified SFAP URL and tenant ID.

Configuration Patterns 

Manual Configuration
1// Provide connection information directly
2let connectionInfo = AgentforceConnectionInfo(
3    sfapURL: "https://api.salesforce.com",
4    tenantId: "core/prod/00D000000000000AAA"
5)
6
7let config = AgentforceConfiguration(
8    user: currentUser,
9    forceConfigEndpoint: "https://myorg.salesforce.com",
10    agentforceFeatureFlagSettings: featureFlags,
11    agentforceConnectionInfo: connectionInfo,
12    salesforceNetwork: networkManager
13)

When agentforceConnectionInfo is nil in AgentforceConfiguration, the SDK automatically queries connection information from the configured forceConfigEndPoint during initialization.

Automatic Discovery
1let config = AgentforceConfiguration(
2    user: currentUser,
3    forceConfigEndpoint: "https://myorg.salesforce.com",
4    agentforceFeatureFlagSettings: featureFlags,
5    agentforceConnectionInfo: nil, // SDK will discover automatically
6    salesforceNetwork: networkManager
7)