# API Reference

This is the complete reference for every public API exposed by the React Native SDK default `IncodeSdk` export from `@incode-sdks/react-native-incode-sdk`.

## initialize

Initializes the native Incode SDK. Must be called at least once per app lifecycle before any other operation.

**Signature**

```ts
IncodeSdk.initialize({
  testMode?: boolean;
  apiConfig: {
    key?: string;
    url: string;
    e2eeUrl?: string;
  };
  sdkMode?: 'standard' | 'captureOnly' | 'submitOnly';
  waitForTutorials?: boolean;
  sslPinningConfig?: { enabled: boolean };
  disableJailbreakDetection?: boolean;
  externalAnalyticsEnabled?: boolean;
  loggingEnabled?: boolean;
  externalScreenshotsEnabled?: boolean;
  clientExperimentId?: string | null;
}): Promise<void>
```

**Required Parameters**

- `apiConfig.url`: API URL provided by Incode.

**Optional Parameters**

- `testMode`: Set to `true` if running on simulators/emulators, `false` when running on devices. Default is `false`.
- `apiConfig.key`: API key provided by Incode. Omit this when using a backend-created token with the Sections API.
- `apiConfig.e2eeUrl`: Custom server URL used for End-to-End Encryption (E2EE).
- `sdkMode`: Specify `standard`, `captureOnly`, or `submitOnly`. Default is `standard`. `captureOnly` works completely offline and for ID and Selfie scan only captures images without validations. `submitOnly` submits previously captured data without performing new captures.
- `waitForTutorials`: Specify `false` to let users press continue on video tutorial screens without waiting for the video to complete. Default is `true`.
- `sslPinningConfig.enabled`: Set to `true` to enable SSL pinning, `false` otherwise.
- `disableJailbreakDetection`: Set to `true` to disable jailbreak detection. Valid only for iOS. Default is `false`.
- `externalAnalyticsEnabled`: Set to `true` to enable external analytics. Default is `true`.
- `loggingEnabled`: Set to `true` to enable logging. Default is `true`.
- `externalScreenshotsEnabled`: Set to `true` to enable external screenshots. Default is `false`.
- `clientExperimentId`: Used to enroll the customer into specific SDK experiences. Pass `experimentV2` to activate V2 on V2-enabled environments.

**Returns / Callbacks**

- Returns `Promise<void>` when initialization succeeds.
- Rejects with `IncodeSdkInitError`. Exported `code` values are:
  - `simulatorDetected`: running on a simulator without passing `testMode: true`.
  - `testModeEnabled`: `testMode: true` was passed while running on a real device (test mode is only allowed on simulators).
  - `invalidInitParams`: the native project isn't configured correctly (for example, a malformed Incode config file).
  - `configError`: `apiConfig`/`url` is missing or incomplete.
  - `unknown`: catch-all for unrecognized native errors.

**Example**

```ts
try {
  await IncodeSdk.initialize({
    testMode: false,
    apiConfig: {
      key: 'YOUR_API_KEY',
      url: 'YOUR_API_URL',
    },
  });
  console.log('Incode initialized successfully');
} catch (error) {
  const e = error as IncodeSdkInitError;
  console.error(e.code + ' - ' + e.message);
}
```

## isInitialized

Checks whether the native Incode SDK has finished initialization.

**Signature**

```ts
IncodeSdk.isInitialized(): Promise<boolean>
```

**Parameters**

- None.

**Returns / Callbacks**

- Returns `Promise<boolean>` that resolves to `true` if the native SDK is initialized, otherwise `false`.

**Example**

```ts
const ready = await IncodeSdk.isInitialized();
if (ready) {
  // Safe to start onboarding.
}
```

## setSdkMode

Changes the SDK mode after initialization.

**Signature**

```ts
IncodeSdk.setSdkMode(
  sdkMode: 'standard' | 'captureOnly' | 'submitOnly'
): Promise<any>
```

**Required Parameters**

- `sdkMode`: One of `standard`, `captureOnly`, or `submitOnly`.

**Returns / Callbacks**

- Returns a promise that resolves after the native SDK mode is updated.
- Rejects if `sdkMode` is not one of the supported values.

**Example**

```ts
await IncodeSdk.setSdkMode('captureOnly');
```

## startOnboarding

Creates a session and runs a complete, locally-defined onboarding flow end to end.

**Signature**

```ts
IncodeSdk.startOnboarding({
  sessionConfig?: OnboardingSessionConfig;
  flowConfig?: OnboardingFlowConfig;
  recordSessionConfig?: OnboardingRecordSessionConfig;
}): Promise<OnboardingResponse>
```

**Optional Parameters**

- `sessionConfig`: [Session configuration](#shared-types). Use it to pass region, queue, Dashboard configuration, backend-created `interviewId`/`token`, custom fields, validation modules, E2EE, and recording settings.
- `flowConfig`: Ordered list of modules to execute. See [Modules](react-native-modules.md).
- `recordSessionConfig`: Optional [recording configuration](#shared-types) for ID and Selfie capture.

**Returns / Callbacks**

- Returns [`Promise<OnboardingResponse>`](#shared-types).
- Resolves with `{ status: 'success' }` when the flow completes.
- Resolves with `{ status: 'userCancelled' }` when the user cancels.
- Rejects with `IncodeSdkFlowError`. Exported `code` values include `permissionsDenied`, `faceAuthenticationFailed`, `sslPinningFailed`, `locationUnavailable` and `unknown`.

**Example**

```ts
const result = await IncodeSdk.startOnboarding({
  sessionConfig: {
    region: 'ALL',
  },
  flowConfig: [
    { module: 'IdScan' },
    { module: 'SelfieScan' },
    { module: 'FaceMatch' },
  ],
});
```

## setupOnboardingSession

Creates or attaches to an onboarding session for section-based flows.

**Signature**

```ts
IncodeSdk.setupOnboardingSession({
  sessionConfig?: OnboardingSessionConfig;
}): Promise<OnboardingSession>
```

**Optional Parameters**

- `sessionConfig`: Session configuration. Provide `token` or `interviewId` to attach to a backend-created session.

**Returns / Callbacks**

- Returns `Promise<OnboardingSession>`.
- `interviewId`: Unique identifier of the onboarding session.
- `token`: Token created for this onboarding session.

**Example**

```ts
const session = await IncodeSdk.setupOnboardingSession({
  sessionConfig: {
    token: 'YOUR_TOKEN',
  },
});

console.log(session.interviewId, session.token);
```

## startOnboardingSection

Starts one section in a section-based flow.

**Signature**

```ts
IncodeSdk.startOnboardingSection({
  flowConfig?: OnboardingFlowConfig;
  recordSessionConfig?: OnboardingRecordSessionConfig;
  sectionTag?: string;
}): Promise<OnboardingSectionResponse>
```

**Optional Parameters**

- `flowConfig`: Ordered list of modules for this section. `startOnboardingSection` accepts the same modules as `startOnboarding`; see [Modules](react-native-modules.md).
- `recordSessionConfig`: Optional [recording configuration](#shared-types) for ID and Selfie capture.
- `sectionTag`: Unique identifier for the section you want to start.

**Returns / Callbacks**

- Returns [`Promise<OnboardingSectionResponse>`](#shared-types).
- `status`: `success` or `userCancelled`.
- `sectionTag`: Value of the `sectionTag` parameter passed in config.

**Example**

```ts
const idSection = await IncodeSdk.startOnboardingSection({
  flowConfig: [{ module: 'IdScan' }],
  sectionTag: 'idSection',
});

if (idSection.status === 'success') {
  await IncodeSdk.startOnboardingSection({
    flowConfig: [{ module: 'SelfieScan' }],
    sectionTag: 'selfieSection',
  });
}
```

You can start multiple sections, but only one at a time. Call `finishOnboardingFlow()` after all sections complete.

## finishOnboardingFlow

Finishes the current section-based onboarding session.

**Signature**

```ts
IncodeSdk.finishOnboardingFlow(): Promise<any>
```

**Parameters**

- None.

**Returns / Callbacks**

- Returns a promise that resolves after the current section-based onboarding session is finished.

**Example**

```ts
await IncodeSdk.finishOnboardingFlow();
```

## startFlow

Starts a Dashboard-configured flow.

**Signature**

```ts
IncodeSdk.startFlow({
  sessionConfig?: OnboardingSessionConfig;
  moduleId?: string;
}): Promise<OnboardingResponse>
```

**Required Parameters**

- `sessionConfig.configurationId`: Configuration ID of a flow on the Dashboard.

**Optional Parameters**

- `sessionConfig`: Same [session configuration](#shared-types) shape used by `startOnboarding`.
- `moduleId`: Module name to start the flow from, for example `EMAIL` or `PHONE`. If omitted, the flow starts from the first module in the configuration. See [valid `moduleId` values](#valid-moduleid-values) below.

**Returns / Callbacks**

- Returns [`Promise<OnboardingResponse>`](#shared-types).
- Resolves with `{ status: 'success' }` or `{ status: 'userCancelled' }`.
- Rejects with `IncodeSdkFlowError`.

**Example**

```ts
await IncodeSdk.startFlow({
  sessionConfig: {
    configurationId: 'YOUR_CONFIGURATION_ID',
  },
  moduleId: 'EMAIL',
});
```

### Valid moduleId values

`moduleId` values correspond to the modules documented in [Modules](react-native-modules.md), using the module's underlying `moduleId` string rather than its `flowConfig` `module` name:

| Module               | `moduleId`                                                                              |
| -------------------- | --------------------------------------------------------------------------------------- |
| Phone                | `PHONE`                                                                                 |
| DocumentScan         | `DOCUMENT_CAPTURE`                                                                      |
| Geolocation          | `GEOLOCATION`                                                                           |
| UserConsent          | `USER_CONSENT`                                                                          |
| CombinedConsent      | `COMBINED_CONSENT`                                                                      |
| Signature            | `SIGNATURE`                                                                             |
| VideoSelfie          | `ACCEPT_VIDEO_SELFIE`                                                                   |
| IdScan               | `ID`                                                                                    |
| IdScanFront          | `ID_CAPTURE`                                                                            |
| IdScanBack           | `BACK_ID`                                                                               |
| ProcessId            | `PROCESS_ID`                                                                            |
| Conference           | `CONFERENCE`                                                                            |
| SelfieScan           | `SELFIE`                                                                                |
| FaceMatch            | `FACE_MATCH`                                                                            |
| QrScan               | `QR_SCAN`                                                                               |
| Captcha              | `OTP`                                                                                   |
| Email                | `EMAIL`                                                                                 |
| Approve              | `USER_APPROVAL`                                                                         |
| UserScore            | `SCORE`                                                                                 |
| MLConsent            | `ML_CONSENT` (or `ML_CONSENT_US_FORMAT` / `ML_CONSENT_GDPR_FORMAT` depending on `type`) |
| GovernmentValidation | `GOVERNMENT VALIDATION`                                                                 |
| Antifraud            | `ANTIFRAUD`                                                                             |
| GlobalWatchlist      | `INCODE_WATCHLIST`                                                                      |
| CustomWatchlist      | `WATCHLIST`                                                                             |
| Aes                  | `AES`                                                                                   |
| Name                 | `NAME_CAPTURE`                                                                          |
| CURP                 | `CURP_VALIDATION`                                                                       |
| OCREdit              | `EDITABLE_OCR`                                                                          |
| eKYB                 | `EKYB`                                                                                  |
| eKYC                 | `EKYC`                                                                                  |
| NFCScan              | `NFC_SCAN` (or `NFC_SCAN_SYMBOL_CHECK_SCREEN` / `NFC_SCAN_VALIDATION`)                  |
| FaceAuthentication   | `AUTHENTICATION`                                                                        |

## startWorkflow

Starts a Dashboard-configured workflow.

**Signature**

```ts
IncodeSdk.startWorkflow({
  sessionConfig?: OnboardingSessionConfig;
}): Promise<OnboardingResponse>
```

**Required Parameters**

- `sessionConfig.configurationId`: Configuration ID of a workflow on the Dashboard.

**Optional Parameters**

- `sessionConfig`: Same [session configuration](#shared-types) shape used by `startOnboarding`.

**Returns / Callbacks**

- Returns [`Promise<OnboardingResponse>`](#shared-types).
- Resolves with `{ status: 'success' }` or `{ status: 'userCancelled' }`.
- Rejects with `IncodeSdkFlowError`.

**Example**

```ts
const result = await IncodeSdk.startWorkflow({
  sessionConfig: {
    configurationId: 'YOUR_CONFIGURATION_ID',
  },
});
```

## startFlowFromDeepLink

Starts a flow from a deep link URL.

**Signature**

```ts
IncodeSdk.startFlowFromDeepLink(
  url: string,
  isShortened?: boolean
): Promise<OnboardingResponse>
```

**Required Parameters**

- `url`: Deep link URL.

**Optional Parameters**

- `isShortened`: Specify whether the URL is shortened. Defaults to `false`.

**Returns / Callbacks**

- Returns [`Promise<OnboardingResponse>`](#shared-types).
- Rejects with `IncodeSdkFlowError`.

**Example**

```ts
await IncodeSdk.startFlowFromDeepLink('YOUR_DEEP_LINK_URL', false);
```

## onSessionCreated

Subscribes to onboarding session creation events.

**Signature**

```ts
IncodeSdk.onSessionCreated(
  listener: (session: OnboardingSession) => void
): () => void
```

**Required Parameters**

- `listener`: Callback that receives [`OnboardingSession`](#shared-types).

**Returns / Callbacks**

- Returns an unsubscriber function.
- Listener receives `interviewId` and `token`.

**Example**

```ts
const unsubscribe = IncodeSdk.onSessionCreated((session) => {
  console.log('Onboarding session created, interviewId: ' + session.interviewId);
});
```

## onStepCompleted

Subscribes to step completion events for a specific module.

**Signature**

```ts
IncodeSdk.onStepCompleted({
  module: string;
  listener: (event: StepCompletedEvent) => void;
}): () => void
```

**Required Parameters**

- `module`: Module name to listen for.
- `listener`: Callback invoked when the selected module completes.

**Returns / Callbacks**

- Returns an unsubscriber function.
- Listener payloads are documented in [Results](react-native-results.md).

**Example**

```ts
const unsubscribe = IncodeSdk.onStepCompleted({
  module: 'SelfieScan',
  listener: (event) => {
    console.log('SELFIE SCAN completed', event.result);
  },
});
```

## onStepUpdated

Subscribes to in-progress step update events.

**Signature**

```ts
IncodeSdk.onStepUpdated({
  module: 'Conference' | 'IdScanFront' | 'IdScanBack' | 'SelfieScan';
  listener: (event: StepUpdatedEvent) => void;
}): () => void
```

**Required Parameters**

- `module`: Supported update module: `Conference`, `IdScanFront`, `IdScanBack`, or `SelfieScan`.
- `listener`: Callback invoked when the selected module emits an update.

**Returns / Callbacks**

- Returns an unsubscriber function.
- Fires for Conference queue/wait-time changes and after every individual capture attempt for `IdScanFront`, `IdScanBack`, and `SelfieScan`.

**Example**

```ts
const unsubscribe = IncodeSdk.onStepUpdated({
  module: 'IdScanFront',
  listener: (event) => {
    console.log('ID Scan Front Attempt: ', event.result);
    console.log('allAttemptsExhausted:', event.result.allAttemptsExhausted);
  },
});
```

## onStepError

Subscribes to module error events.

**Signature**

```ts
IncodeSdk.onStepError({
  module: string;
  listener: (event: StepErrorEvent) => void;
}): () => void
```

**Required Parameters**

- `module`: Module name to listen for.
- `listener`: Callback invoked when the selected module emits an error.

**Returns / Callbacks**

- Returns an unsubscriber function.
- Error payloads are documented in [Results](react-native-results.md).

**Example**

```ts
const unsubscribe = IncodeSdk.onStepError({
  module: 'FaceMatch',
  listener: (event) => {
    console.log('FaceMatch error', event);
  },
});
```

## onEvents

Subscribes to tracking events.

**Signature**

```ts
IncodeSdk.onEvents(
  listener: (events: Events) => void
): () => void
```

**Required Parameters**

- `listener`: Callback invoked with `{ events: EventDetails[] }`.

**Returns / Callbacks**

- Returns an unsubscriber function.
- Register before starting the flow.

**Example**

```ts
const unsubscribe = IncodeSdk.onEvents((eventBatch) => {
  for (const event of eventBatch.events) {
    console.log(event.event, event.data);
  }
});
```

## approve

Programmatically initiates approval of the current user.

**Signature**

```ts
IncodeSdk.approve({
  forceApproval: boolean;
}): Promise<ApprovalResult>
```

**Required Parameters**

- `forceApproval`: If `true`, the user will be force-approved.

Older text may call this setting `forceApprove`; in the React Native SDK config object the current parameter is `forceApproval`.

**Returns / Callbacks**

- Returns `Promise<ApprovalResult>`.
- Result contains `status`, `id`, and `customerToken`.
- The field `status` can take values: `approved` and `failed`.

**Example**

```ts
IncodeSdk.approve({ forceApproval: false })
  .then((result) => {
    console.log('approve finished: ', result);
  })
  .catch((error) => {
    console.log('approve error: ', error);
  });
```

## getUserScore

Fetches the current user score programmatically.

**Signature**

```ts
IncodeSdk.getUserScore(config?: {
  mode?: 'accurate' | 'fast';
}): Promise<UserScore>
```

**Optional Parameters**

- `mode`: `accurate` or `fast`. Defaults to `accurate`. `accurate` fetches server-side results and can take longer; `fast` uses on-device processing.

**Returns / Callbacks**

- Returns `Promise<UserScore>`.
- Result contains the same data as the `UserScore` module result.

**Example**

```ts
IncodeSdk.getUserScore({ mode: 'accurate' })
  .then((score) => console.log(score))
  .catch((error) => {
    console.error('Get user score failed', error);
  });
```

## faceMatch

Programmatically initiates face match between photo from the ID and Selfie.

**Signature**

```ts
IncodeSdk.faceMatch(): Promise<FaceMatchCompleteEvent>
```

**Parameters**

- None.

**Returns / Callbacks**

- Returns `Promise<FaceMatchCompleteEvent>`.
- Runs silently in the background, compared to the regular `FaceMatch` module that shows UI feedback to the user.

**Example**

```ts
IncodeSdk.faceMatch()
  .then((faceMatchResult) => {
    console.log('Face match result: ', faceMatchResult);
  })
  .catch((error) => {
    console.error('Face match failed', error);
  });
```

## startFaceLogin

Starts Face Login authentication. A prerequisite for a successful Face Login is that the user has an approved account with an enrolled face.

**Signature**

```ts
IncodeSdk.startFaceLogin({
  showTutorials: boolean;
  customerUUID?: string;
  faceMaskCheck?: boolean;
  lensesCheck?: boolean;
  brightnessThreshold?: number;
  logAuthenticationEnabled?: boolean;
  e2eeEncryptionEnabled?: boolean;
}): Promise<FaceLoginResult>
```

**Required Parameters**

- `showTutorials`: Show tutorials before Face Login.

**Optional Parameters**

- `customerUUID`: Required for 1:1 Face Login. Omit for 1:N database lookup.
- `faceMaskCheck`: Specify `true` to prevent login for users wearing a face mask.
- `lensesCheck`: Specify whether the SDK should check for lenses/glasses.
- `brightnessThreshold`: Deprecated. Adjusts minimum lighting requirements.
- `logAuthenticationEnabled`: Enable authentication logging.
- `e2eeEncryptionEnabled`: Enable E2EE for the authentication flow.

**Returns / Callbacks**

- Returns `Promise<FaceLoginResult>`.
- Response fields are documented in [Results](react-native-results.md#startfacelogin).

**Example**
1:1 Face Login performs a 1:1 face comparison and returns a successful match if the two faces match. For 1:1 Face Login, you need the user's `customerUUID`. If the user was approved during onboarding on the mobile device, you should have received `customerUUID` as a result of the `Approve` step.

```ts
const result = await IncodeSdk.startFaceLogin({
  showTutorials: true,
  customerUUID: 'YOUR_CUSTOMER_UUID',
  faceMaskCheck: false,
  lensesCheck: false,
  logAuthenticationEnabled: false,
  e2eeEncryptionEnabled: false,
});
```

1:N Face Login performs a database face lookup and returns a successful match if the face is found in the database. Omit `customerUUID` for 1:N Face Login.

```ts
const result = await IncodeSdk.startFaceLogin({
  showTutorials: true,
  faceMaskCheck: false,
  lensesCheck: false,
  logAuthenticationEnabled: false,
  e2eeEncryptionEnabled: false,
});
```

To enable `faceMaskCheck` on Android, add:

```gradle
implementation 'com.incode.sdk:model-mask-detection:2.0.0'
```

## deleteLocalUserData

Deletes locally stored onboarding session data on Android devices.

**Signature**

```ts
IncodeSdk.deleteLocalUserData(): Promise<any>
```

**Parameters**

- None.

**Returns / Callbacks**

- Returns a promise that resolves after local onboarding data is deleted.
- This can remove up to 5-6 MB of data stored locally during onboarding.

Older text may refer to this method as `deleteUserLocalData`; the current React Native SDK method is `deleteLocalUserData`. The method is exposed on both platforms, but it is currently a no-op on iOS - only the Android implementation deletes data.

**Example**

```ts
await IncodeSdk.deleteLocalUserData();
```

## showCloseButton

Shows or hides the close button during SDK flows.

**Signature**

```ts
IncodeSdk.showCloseButton(
  shouldShowCloseButton: boolean
): Promise<void>
```

**Required Parameters**

- `shouldShowCloseButton`: Set to `true` to show the close button, or `false` to hide it.

**Returns / Callbacks**

- Returns `Promise<void>`.
- When the user presses the close button, the flow is aborted.

**Example**

```ts
IncodeSdk.showCloseButton(true);
```

## setLocalizationLanguage

Sets runtime localization language.

**Signature**

```ts
IncodeSdk.setLocalizationLanguage(
  language: string
): Promise<string>
```

**Required Parameters**

- `language`: Language used for runtime localization. Supported values are currently `en`, `es`, and `pt`.

**Returns / Callbacks**

- Returns `Promise<string>`.

**Example**

```ts
await IncodeSdk.setLocalizationLanguage('en');
```

Android requires:

```gradle
implementation 'com.incode.sdk:extensions:1.2.1'
```

## setString

Sets and updates string resources at runtime.

**Signature**

```ts
IncodeSdk.setString(
  strings: { [key: string]: string }
): Promise<void>
```

**Required Parameters**

- `strings`: Map of string keys and values.

**Returns / Callbacks**

- Returns `Promise<void>`.

Some native documentation writes this as `IncodeSDK.setString`; in React Native, call `IncodeSdk.setString`.

**Example**

For iOS:

```ts
IncodeSdk.setString({
  'incdOnboarding.idChooser.idButton': 'Id',
});
```

For Android:

```ts
IncodeSdk.setString({
  onboard_sdk_btn_passport: 'Passport',
});
```

Android requires:

```gradle
implementation 'com.incode.sdk:extensions:1.2.1'
```

For iOS, see [Localization Guide](https://developer.incode.com/docs/localization-guide#list-of-localizable-texts). For Android, see [Dynamic Localization](https://developer.incode.com/docs/user-guide-customization#32-dynamic-localization).

## setQuantityStrings

Sets Android plural strings at runtime.

**Signature**

```ts
IncodeSdk.setQuantityStrings(
  strings: { [key: string]: any }
): Promise<any>
```

**Required Parameters**

- `strings`: Map of language codes to plural string keys and plural values.

**Returns / Callbacks**

- Returns a promise that resolves after plural strings are updated.

**Example**

```ts
await IncodeSdk.setQuantityStrings({
  en: {
    onboard_sdk_validation_attempts_remaining: {
      one: '%d attempt remaining',
      other: '%d attempts remaining',
    },
  },
});
```

## setTheme

Applies a JSON theme.

**Signature**

```ts
IncodeSdk.setTheme({
  jsonTheme: string;
}): Promise<any>
```

**Required Parameters**

- `jsonTheme`: JSON string containing theme configuration.

**Returns / Callbacks**

- Returns a promise that resolves after the theme is applied.

**Example**

```ts
await IncodeSdk.setTheme({
  jsonTheme: JSON.stringify({
    colors: {
      accent: '#00B2FD',
      primary: '#20263D',
    },
  }),
});
```

## setUXConfig

Applies UX configuration for V2 ID scan and Selfie experiences.

**Signature**

```ts
IncodeSdk.setUXConfig({
  jsonConfig: string;
}): Promise<any>
```

**Required Parameters**

- `jsonConfig`: JSON string containing UX configuration.

**Returns / Callbacks**

- Returns a promise that resolves after the UX configuration is applied.

**Example**

```ts
await IncodeSdk.setUXConfig({
  jsonConfig: JSON.stringify({
    showFooter: true,
    closeButtonPosition: 'topLeft',
    helpButtonPosition: 'bottomRight',
    headerAlignment: 'center',
    realtimeFeedbackMessageUIFlavor: 'standard',
  }),
});
```

For the full set of UX configuration properties and their possible values, see the platform customization guides: [Android](https://developer.incode.com/docs/android-customization) and [iOS](https://developer.incode.com/docs/user_guide_customization_v2).

## setFaceAuthenticationHint

Provides a face authentication hint for the `FaceAuthentication` module.

**Signature**

```ts
IncodeSdk.setFaceAuthenticationHint(
  faceAuthenticationHint: string | { faceAuthenticationHint: string }
): Promise<void>
```

**Required Parameters**

- `faceAuthenticationHint`: Hint string, or object containing `faceAuthenticationHint`.

**Returns / Callbacks**

- Returns `Promise<void>`.
- On Android, both a plain string and an object with a `faceAuthenticationHint` field are accepted. On iOS, only the object form is reliably supported; a plain string may not be handled the same way. For cross-platform code, prefer the object form.

**Example**

```ts
await IncodeSdk.setFaceAuthenticationHint({ faceAuthenticationHint: 'customer@example.com' });
```

## onResourceDownloadProgressUpdated

Subscribes to Dynamic Delivery resource download progress.

**Signature**

```ts
IncodeSdk.onResourceDownloadProgressUpdated(
  listener: (event: { progress: Number }) => void
): () => void
```

**Required Parameters**

- `listener`: Callback invoked with download progress.

**Returns / Callbacks**

- Returns an unsubscriber function.

**Example**

```ts
const unsubscribe = IncodeSdk.onResourceDownloadProgressUpdated(({ progress }) => {
  console.log(progress);
});
```

## checkOnDemandResourcesDownloaded

Checks whether Dynamic Delivery resources are already downloaded.

**Signature**

```ts
IncodeSdk.checkOnDemandResourcesDownloaded(config?: {
  moduleName: string;
}): Promise<any>
```

**Optional Parameters**

- `moduleName`: Module name to check resources for.

**Returns / Callbacks**

- Returns a promise that resolves with `{ status: 'true' | 'false' }` indicating whether the resources are already downloaded.

**Example**

```ts
await IncodeSdk.checkOnDemandResourcesDownloaded({ moduleName: 'IdScan' });
```

## downloadOnDemandResources

Downloads Dynamic Delivery resources.

**Signature**

```ts
IncodeSdk.downloadOnDemandResources(config?: {
  moduleName: string;
}): Promise<any>
```

**Optional Parameters**

- `moduleName`: Module name to download resources for.

**Returns / Callbacks**

- Returns a promise that resolves with `{ status: 'success' }` when the native download operation completes.

**Example**

```ts
await IncodeSdk.downloadOnDemandResources({ moduleName: 'IdScan' });
```

## removeOnDemandResources

Removes Dynamic Delivery resources.

**Signature**

```ts
IncodeSdk.removeOnDemandResources(config?: {
  moduleName: string;
}): Promise<any>
```

**Optional Parameters**

- `moduleName`: Module name to remove resources for.

**Returns / Callbacks**

- Returns a promise that resolves with `{ status: 'success' }` when the native remove operation completes.

**Example**

```ts
await IncodeSdk.removeOnDemandResources({ moduleName: 'IdScan' });
```

## Shared types

Common types used by multiple API methods.

**Signature**

```ts
type OnboardingSessionConfig = {
  region?: string;
  queue?: string;
  interviewId?: string;
  token?: string;
  configurationId?: string;
  externalId?: string;
  externalCustomerId?: string;
  customFields?: { [key: string]: string };
  validationModules?: ValidationModule[];
  e2eEncryptionEnabled?: boolean;
  mergeSessionRecordings?: boolean;
  voiceConsentLanguage?: string;
};

type OnboardingRecordSessionConfig = {
  recordSession: boolean;
  forcePermissions: boolean;
};

type OnboardingResponse = {
  status: 'success' | 'userCancelled';
};

type OnboardingSession = {
  interviewId: string;
  token: string;
};

type OnboardingSectionResponse = OnboardingResponse & {
  sectionTag: string;
};
```

**OnboardingSessionConfig Fields**

- `region`: Region, currently `ALL` (covers all regions), `BR` (optimized for Brazil), or `IN` (optimized for India).
- `queue`: Queue to attach this onboarding session to.
- `interviewId`: Backend-created onboarding session interview ID.
- `configurationId`: Dashboard flow configuration ID.
- `token`: Backend-created onboarding session token.
- `externalId`: ID used outside of Incode Omni.
- `externalCustomerId`: Identifier that links the onboarding session to an external prospect or customer ID.
- `validationModules`: Validation modules enabled for this session.
- `customFields`: Custom data attached to this onboarding session.
- `e2eEncryptionEnabled`: Enable E2EE.
- `mergeSessionRecordings`: Merge recordings from ID capture and Face capture into a single video.
- `voiceConsentLanguage`: Language for `VideoSelfie` voice consent. Supported values are currently `en`, `es`, `pt`, and `he`.

**OnboardingRecordSessionConfig Fields**

- `recordSession`: Set to `true` to enable ID and Selfie capture screen recording.
- `forcePermissions`: Set to `true` to abort the session if the user denies permissions, or `false` otherwise.

<br />
