React Native Development

This section provides reference documentation for the Agentforce Mobile SDK for React Native.

The Agentforce Mobile SDK for React Native is a bridge to the native iOS and Android SDKs, providing a JavaScript API to configure and launch Agentforce conversations. Import the SDK as:

AgentforceService is a singleton instance. All methods are called directly on this object.

All methods are available on the AgentforceService singleton.

MethodDescription
configure(config)Configure the SDK with Service or Employee Agent settings
isConfigured()Check if the SDK is configured and ready
getConfigurationInfo()Get detailed configuration information including mode
MethodDescription
launchConversation()Open the conversation UI (preserves existing conversation)
startNewConversation()Close existing conversation and start fresh
closeConversation()Close the current conversation and dismiss UI
MethodDescription
setLoggerDelegate(delegate)Register a logger delegate for SDK log messages
clearLoggerDelegate()Remove the logger delegate
setNavigationDelegate(delegate)Register a navigation delegate
clearNavigationDelegate()Remove the navigation delegate
setViewProviderDelegate(delegate)Register a view provider delegate
clearViewProviderDelegate()Clear the view provider delegate
MethodDescription
setAdditionalContext(context)Set additional context for the current conversation
registerHiddenPreChatFields(fields)Pre-register hidden prechat field values
clearHiddenPreChatFields()Clear all hidden prechat fields
getHiddenPreChatFields()Get currently registered hidden prechat fields
MethodDescription
getFeatureFlags()Read persisted feature flags from native storage
setFeatureFlags(flags)Save feature flags to native storage
getEmployeeAgentId()Get the stored Employee Agent ID
setEmployeeAgentId(agentId)Set the Employee Agent ID in native storage
resetSettings()Clear all SDK state
MethodDescription
destroy()Clean up all resources (call on app shutdown)