---
schema_version: "1"
id: 16422f1fc5851483ee48f5126462fb2b9cb2504dc9beaa61d1150ae974d50536
title: Configuration Reference - React Native
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/genai/agentforce-mobile-sdk/references/react-native/configuration-overview-react-native.md
canonical_url: https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/configuration-overview-react-native.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 6c39167bd614921ae07f3d7efb27538e090ec0b8d8ff4d5f9dbc664613f578e8
products:
  - Agentforce Mobile SDK
  - Agentforce and Einstein Generative AI
---
# Configuration Reference - React Native

Reference documentation for configuration types in the Agentforce Mobile SDK for React Native.

## AgentConfig

The configuration passed to `configure()` is a discriminated union type:

```tsx
type AgentConfig = ServiceAgentConfig | EmployeeAgentConfig;
```

## ServiceAgentConfig

Configuration for Service Agent mode (anonymous/guest access).

```tsx
interface ServiceAgentConfig {
  type: "service";
  serviceApiURL: string;
  organizationId: string;
  esDeveloperName: string;
  featureFlags?: FeatureFlags;
}
```

### Fields

| Field             | Type           | Required | Description                                                                                        |
| ----------------- | -------------- | -------- | -------------------------------------------------------------------------------------------------- |
| `type`            | `'service'`    | Yes      | Must be `'service'`                                                                                |
| `serviceApiURL`   | `string`       | Yes      | The Service API URL for your deployment. Found in Setup > Embedded Service Deployments > Settings. |
| `organizationId`  | `string`       | Yes      | Your Salesforce Organization ID. Can be 15 or 18 characters.                                       |
| `esDeveloperName` | `string`       | Yes      | The developer name of your Embedded Service deployment.                                            |
| `featureFlags`    | `FeatureFlags` | No       | Optional feature flags.                                                                            |

## EmployeeAgentConfig

Configuration for Employee Agent mode (authenticated access).

```tsx
interface EmployeeAgentConfig {
  type: "employee";
  instanceUrl: string;
  organizationId: string;
  userId: string;
  agentId?: string;
  agentLabel?: string;
  accessToken?: string;
  featureFlags?: FeatureFlags;
}
```

### Fields

| Field            | Type           | Required | Description                                                                                                  |
| ---------------- | -------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| `type`           | `'employee'`   | Yes      | Must be `'employee'`                                                                                         |
| `instanceUrl`    | `string`       | Yes      | Your Salesforce instance URL (for example, `https://myorg.my.salesforce.com`).                               |
| `organizationId` | `string`       | Yes      | Salesforce Organization ID.                                                                                  |
| `userId`         | `string`       | Yes      | The Salesforce User ID of the authenticated user.                                                            |
| `agentId`        | `string`       | No       | The Agentforce Agent ID. If omitted and `enableMultiAgent` is true, the SDK picks the first available agent. |
| `agentLabel`     | `string`       | No       | A display label shown in the conversation UI title bar (Android).                                            |
| `accessToken`    | `string`       | No       | OAuth access token. Can be provided directly or obtained via Mobile SDK auth.                                |
| `featureFlags`   | `FeatureFlags` | No       | Optional feature flags.                                                                                      |

## FeatureFlags

Feature flags control optional SDK capabilities.

```tsx
interface FeatureFlags {
  enableMultiAgent: boolean; // default: true
  enableMultiModalInput: boolean; // default: false
  enablePDFUpload: boolean; // default: false
  enableVoice: boolean; // default: false
  enableCustomViewProvider: boolean; // default: false
}
```

### Flag Details

| Flag                       | Default | Description                                                                                  |
| -------------------------- | ------- | -------------------------------------------------------------------------------------------- |
| `enableMultiAgent`         | `true`  | When true and no `agentId` is specified, the SDK bootstraps and picks from available agents. |
| `enableMultiModalInput`    | `false` | Enables camera and image attachment capabilities. Requires camera/photo permissions.         |
| `enablePDFUpload`          | `false` | Enables PDF file upload in the conversation.                                                 |
| `enableVoice`              | `false` | Enables voice input (microphone). Requires microphone permission.                            |
| `enableCustomViewProvider` | `false` | Enables the custom view provider system.                                                     |

## ConfigurationResult

Returned by `configure()` from the native layer:

```tsx
interface ConfigurationResult {
  success: boolean; // Whether configuration succeeded
  mode: "service" | "employee"; // The mode that was configured
  description?: string; // Optional description
}
```

## ConfigurationInfo

Returned by `getConfigurationInfo()`:

```tsx
interface ConfigurationInfo {
  configured: boolean; // Whether the SDK is configured
  mode: "service" | "employee" | null; // Current mode, null if not configured
  description?: string; // Description of the configuration
}
```

## LegacyServiceAgentConfig (Deprecated)

For backward compatibility, the bridge accepts the legacy format without a `type` field:

```tsx
interface LegacyServiceAgentConfig {
  serviceApiURL: string;
  organizationId: string;
  esDeveloperName: string;
}
```

**note:** This format is deprecated. Use `ServiceAgentConfig` with `type: 'service'` instead.

## Type Guards

The package exports type guard functions:

```tsx
import {
  isServiceAgentConfig,
  isEmployeeAgentConfig,
  isLegacyConfig,
} from "@salesforce/react-native-agentforce";

// Returns true if config.type === 'service'
isServiceAgentConfig(config);

// Returns true if config.type === 'employee'
isEmployeeAgentConfig(config);

// Returns true if config has no 'type' field
isLegacyConfig(config);
```

## See Also

- [Configure the SDK Guide](/docs/ai/agentforce-mobile-sdk/guide/react-native/agentforce-mobile-sdk-react-native-integration)
- [Authentication Reference](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/authentication-overview-react-native.md)
