Install the React Native Agentforce bridge using npm or yarn:
1# Using npm2npm install @salesforce/react-native-agentforce34# Using yarn5yarn 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):
1platform :ios, '17.0'23target 'YourApp' do4 use_frameworks! :linkage => :static56 # React Native pods (from your standard RN template)7 # ...89 # Agentforce React Native bridge10 pod 'ReactNativeAgentforce', :path => '../node_modules/@salesforce/react-native-agentforce/ios'11end
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:
1platform :ios, '17.0'23target 'YourApp' do4 use_frameworks! :linkage => :static56 # React Native pods7 # ...89 # Agentforce bridge with Mobile SDK for Employee Agent auth10 pod 'ReactNativeAgentforce/WithMobileSDK', :path => '../node_modules/@salesforce/react-native-agentforce/ios'11end
The WithMobileSDK subspec adds a dependency on SalesforceSDKCore, which provides OAuth login flows. See Employee Agent Authentication for details.
2. Install Pods
1cd 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:
1<key>NSMicrophoneUsageDescription</key>2<string>Used for voice input with Agentforce</string>
If you enable camera/photo features (enableMultiModalInput: true), add:
1<key>NSCameraUsageDescription</key>2<string>Used to capture images for Agentforce</string>3<key>NSPhotoLibraryUsageDescription</key>4<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:
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:
1import com.salesforce.android.reactagentforce.AgentforcePackage23class MainApplication : Application(), ReactApplication{4 override val reactNativeHost = object : DefaultReactNativeHost(this){5 override fun getPackages(): List<ReactPackage> = listOf(6 MainReactPackage(),7 AgentforcePackage(),8 // ... other packages9)10}11}
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: