Reference documentation for configuration types in the Agentforce Mobile SDK for React Native.
AgentConfig
The configuration passed to configure() is a discriminated union type:
type AgentConfig = ServiceAgentConfig | EmployeeAgentConfig;
ServiceAgentConfig
Configuration for Service Agent mode (anonymous/guest access).
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).
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.
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:
interface ConfigurationResult {
success: boolean; // Whether configuration succeeded
mode: "service" | "employee"; // The mode that was configured
description?: string; // Optional description
}
ConfigurationInfo
Returned by getConfigurationInfo():
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:
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:
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);