AgentforceClient

The primary entry point and orchestrator for all Agentforce SDK functionality. It serves as the central coordinator that manages agent conversations, UI component creation, and service dependencies. It implements a comprehensive architecture that handles authentication, networking, theming, and extensibility through provider protocols.

MethodSignatureDescription
initinit(credentialProvider:mode:viewProvider:themeManager:)Creates an AgentforceClient with full customization capabilities including view provider overrides
startAgentforceConversation(forAgentId:sessionId:)func startAgentforceConversation(forAgentId: String?, sessionId: String?) -> AgentConversationInitiates a new conversation session with an Agentforce agent
startAgentforceConversation(forESDeveloperName:)func startAgentforceConversation(forESDeveloperName: String) -> AgentConversationInitiates a new conversation session with a service agent using Einstein Service developer name
getExistingAgentforceConversationfunc getExistingAgentforceConversation(forAgentId: String, sessionId: String?) -> AgentConversation?Gets an existing Agentforce conversation that matches the specified criteria
createAgentforceChatViewfunc createAgentforceChatView(conversation:delegate:showTopBar:onContainerClose:) throws -> AgentforceChatViewCreates a fully-configured Agentforce chat interface for interactive dialogue
createAgentforceCardfunc createAgentforceCard(chatView:launchChatView:) -> AgentforceCardCreates a compact conversation summary card with follow-up interaction capabilities
createAgentforceLauncherfunc createAgentforceLauncher(chatView:launchChatView:) -> AgentforceLauncherCreates an Agentforce Launcher View
createAgentforceVoiceViewfunc createAgentforceVoiceView(conversation:auraColors:onContainerClose:) throws -> AgentforceVoiceViewCreates an Agentforce Voice View for real time voice interaction