---
schema_version: "1"
id: df784e00cb7befd40cb89736e3418e590126d33ae994b629949d5cafc4fdbcfb
title: Install the React Native SDK
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/genai/agentforce-mobile-sdk/guides/react-native/agentforce-mobile-sdk-react-native-install.md
canonical_url: https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/guide/agentforce-mobile-sdk-react-native-install.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: f4df18dfbf13f8ac0104a2404a765dc87b37dc65eabb5d07891a5451cc7b8706
products:
  - Agentforce Mobile SDK
  - Agentforce and Einstein Generative AI
---
# Install the React Native SDK

Learn how to install the Agentforce Mobile SDK for React Native in your project.

## Prerequisites

Before installing, ensure you meet the [system requirements](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/guide/agentforce-mobile-sdk-react-native-requirements.md).

## Install the Package

Install the React Native Agentforce bridge using npm or yarn:

```bash
# Using npm
npm install @salesforce/react-native-agentforce

# Using yarn
yarn add @salesforce/react-native-agentforce
```

The package includes TypeScript types out of the box. All public exports are available from `'@salesforce/react-native-agentforce'`.

## iOS Setup

Configure your iOS project to use the Agentforce SDK.

### 1. Configure the Podfile

In your `ios/Podfile`, add the bridge pod. The bridge depends on `React-Core` and `AgentforceSDK` (the native iOS SDK distributed via CocoaPods).

**Service Agent only (default):**

```ruby
platform :ios, '17.0'

target 'YourApp' do
  use_frameworks! :linkage => :static

  # React Native pods (from your standard RN template)
  # ...

  # Agentforce React Native bridge
  pod 'ReactNativeAgentforce', :path => '../node_modules/@salesforce/react-native-agentforce/ios'
end
```

**Service Agent + Employee Agent (with Mobile SDK auth):**

If you also need Employee Agent support with OAuth authentication via the Salesforce Mobile SDK, use the `WithMobileSDK` subspec:

```ruby
platform :ios, '17.0'

target 'YourApp' do
  use_frameworks! :linkage => :static

  # React Native pods
  # ...

  # Agentforce bridge with Mobile SDK for Employee Agent auth
  pod 'ReactNativeAgentforce/WithMobileSDK', :path => '../node_modules/@salesforce/react-native-agentforce/ios'
end
```

The `WithMobileSDK` subspec adds a dependency on `SalesforceSDKCore`, which provides OAuth login flows. See [Employee Agent Authentication](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/guide/agentforce-mobile-sdk-react-native-employee-auth.md) for details.

### 2. Install Pods

```bash
cd ios && pod install
```

### 3. Swift Compatibility

The bridge is written in Swift 5.0+. If your app is Objective-C only, Xcode prompts you to create a bridging header on first build.

### 4. Permissions (Optional)

If you enable voice features (`enableVoice: true`), add the microphone usage description to your `Info.plist`:

```xml
<key>NSMicrophoneUsageDescription</key>
<string>Used for voice input with Agentforce</string>
```

If you enable camera/photo features (`enableMultiModalInput: true`), add:

```xml
<key>NSCameraUsageDescription</key>
<string>Used to capture images for Agentforce</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Used to attach images to Agentforce conversations</string>
```

## Android Setup

Configure your Android project to use the Agentforce SDK.

### 1. Configure build.gradle (App Level)

Add the Agentforce Maven repositories and configure your app's `android/app/build.gradle`:

```gradle
android {
    compileSdk 36

    defaultConfig {
        minSdkVersion 29
        targetSdkVersion 36
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
        coreLibraryDesugaringEnabled true
    }

    buildFeatures {
        compose = true
    }
}

repositories {
    google()
    mavenCentral()
    maven { url 'https://jitpack.io' }
    maven { url 'https://opensource.salesforce.com/AgentforceMobileSDK-Android/agentforce-sdk-repository' }
    maven { url 'https://s3.amazonaws.com/inapp.salesforce.com/public/android' }
    maven { url 'https://s3.amazonaws.com/salesforce-async-messaging-experimental/public/android' }
}

dependencies {
    coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.1.5"

    // For Employee Agent with Mobile SDK auth, add:
    // implementation "com.salesforce.mobilesdk:SalesforceReact:13.1.1"
}
```

The bridge library module includes `agentforce-sdk` as an `api` dependency. Your host app must provide `SalesforceReact` at runtime if you use Employee Agent auth.

### 2. Register the Native Package

In your `MainApplication.kt` (or `.java`), register `AgentforcePackage`:

```kotlin
import com.salesforce.android.reactagentforce.AgentforcePackage

class MainApplication : Application(), ReactApplication {
    override val reactNativeHost = object : DefaultReactNativeHost(this) {
        override fun getPackages(): List<ReactPackage> = listOf(
            MainReactPackage(),
            AgentforcePackage(),
            // ... other packages
        )
    }
}
```

`AgentforcePackage` automatically registers `AgentforceModule`. It also registers `EmployeeAgentAuthBridge` if the Salesforce Mobile SDK is detected on the runtime classpath (via reflection). If the Mobile SDK is not present, Employee Agent auth is gracefully disabled.

### 3. Configure AndroidManifest.xml

Register the conversation activity in your `AndroidManifest.xml`:

```xml
<activity
    android:name="com.salesforce.android.reactagentforce.AgentforceConversationActivity"
    android:theme="@style/Theme.AppCompat.Light.NoActionBar"
    android:windowSoftInputMode="adjustResize" />
```

### 4. Permissions (Optional)

For camera/multi-modal input support, add to `AndroidManifest.xml`:

```xml
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
```

## Verify Installation

After installation, verify the native module is available:

```tsx
import { AgentforceService } from "@salesforce/react-native-agentforce";

// Check if the SDK is configured (should return false initially)
const configured = await AgentforceService.isConfigured();
console.log("SDK configured:", configured);
```

If you see errors about the native module not being found, see [Troubleshooting](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/guide/agentforce-mobile-sdk-react-native-troubleshooting.md).

## See Also

- [Quick Start Guide](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/guide/agentforce-mobile-sdk-react-native-quick-start.md)
- [Configure the SDK](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/guide/agentforce-mobile-sdk-react-native-integration.md)
- [Employee Agent Authentication](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/guide/agentforce-mobile-sdk-react-native-employee-auth.md)
