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.
| Method | Description |
|---|
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 |
| Method | Description |
|---|
launchConversation() | Open the conversation UI (preserves existing conversation) |
startNewConversation() | Close existing conversation and start fresh |
closeConversation() | Close the current conversation and dismiss UI |
| Method | Description |
|---|
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 |
| Method | Description |
|---|
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 |
| Method | Description |
|---|
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 |
| Method | Description |
|---|
destroy() | Clean up all resources (call on app shutdown) |