---
schema_version: "1"
id: fd9a6d58d30cf8358c34b4b837622cda90fcdaffb77f917123cc60da745be75f
title: React Native Development
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/genai/agentforce-mobile-sdk/references/react-native/development-react-native.md
canonical_url: https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/development-react-native.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: b1afe012d4d9a398da7212ecbbeb235b5c4999d9b92339ca39b2bb4647f4c490
products:
  - Agentforce Mobile SDK
  - Agentforce and Einstein Generative AI
---
# React Native Development

This section provides reference documentation for the Agentforce Mobile SDK for React Native.

## Overview

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:

```tsx
import { AgentforceService } from "@salesforce/react-native-agentforce";
```

`AgentforceService` is a singleton instance. All methods are called directly on this object.

## Reference Topics

- [Configuration](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/configuration-overview-react-native.md) - Configuration types and options
- [Authentication](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/authentication-overview-react-native.md) - Auth functions and credentials
- [Error Handling](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/error-handling-overview-react-native.md) - Error codes and handling
- [Architecture](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/architecture-integration-react-native.md) - Platform architecture and native module bridge

## AgentforceService Methods

All methods are available on the `AgentforceService` singleton.

### Configuration Methods

| 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     |

### Conversation Methods

| 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              |

### Delegate Methods

| 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                |

### Context and Prechat Methods

| 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      |

### Feature Flags and Settings Methods

| 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                              |

### Lifecycle Methods

| Method      | Description                                   |
| ----------- | --------------------------------------------- |
| `destroy()` | Clean up all resources (call on app shutdown) |

## Related Guides

- [Quick Start Guide](/docs/ai/agentforce-mobile-sdk/guide/react-native/agentforce-mobile-sdk-react-native-quick-start)
- [Configure the SDK](/docs/ai/agentforce-mobile-sdk/guide/react-native/agentforce-mobile-sdk-react-native-integration)
- [Conversations](/docs/ai/agentforce-mobile-sdk/guide/react-native/agentforce-mobile-sdk-react-native-conversations)
- [Delegates](/docs/ai/agentforce-mobile-sdk/guide/react-native/agentforce-mobile-sdk-react-native-delegates)
