SDK reference, React Native SDK

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

IncodeSdk.initialize({
  testMode?: boolean;
  apiConfig: {
    key?: string;
    url: string;
    e2eeUrl?: string;
  };
  sdkMode?: 'standard' | 'captureOnly' | 'submitOnly';
  sslPinningConfig?: { enabled: boolean; forceSSLPinning?: boolean };
  externalAnalyticsEnabled?: boolean;
  loggingEnabled?: boolean;
  externalScreenshotsEnabled?: boolean;
  clientExperimentId?: string | null;
  sendDiagnosticsData?: boolean;
}): 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.
  • sslPinningConfig.enabled: Set to true to enable SSL pinning, false otherwise.
  • sslPinningConfig.forceSSLPinning: Set to true to force SSL pinning. Default is false when omitted.
  • 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.
  • sendDiagnosticsData: Enables or disables sending of SDK diagnostics to Incode. iOS only — accepted but ignored on Android. Native default is true when omitted.

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

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

IncodeSdk.isInitialized(): Promise<boolean>

Parameters

  • None.

Returns / Callbacks

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

Example

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

setSdkMode

Changes the SDK mode after initialization.

Signature

IncodeSdk.setSdkMode(
  sdkMode: 'standard' | 'captureOnly' | 'submitOnly'
): Promise<void>

Required Parameters

  • sdkMode: One of standard, captureOnly, or submitOnly.

Returns / Callbacks

  • Returns Promise<void>.
  • Rejects if sdkMode is not one of the supported values.

Example

await IncodeSdk.setSdkMode('captureOnly');

startOnboarding

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

Signature

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

Optional Parameters

  • sessionConfig: Session configuration. Use it to pass queue, Dashboard configuration, backend-created interviewId/token, custom fields, validation modules, E2EE, and recording settings.
  • flowConfig: Ordered list of modules to execute. See Modules.
  • recordSessionConfig: Optional recording configuration for ID and Selfie capture.

Returns / Callbacks

  • Returns Promise<OnboardingResponse>.
  • Resolves with { status: 'success' } when the flow completes.
  • Rejects with code: 'userCancelled' when the user cancels.
  • Rejects with IncodeSdkFlowError. Exported code values include permissionsDenied, videoSelfieNotCompleted, integrityCompromised, faceAuthenticationFailed, sslPinningFailed, locationUnavailable, storageUnavailable, combinedConsentsNotReceived, userCancelled, interrupted, biometricConsentNotGiven, biometricConsentNotReceived, configError (startWorkflow only) and unknown. See the error enums for the full list and platform notes.
  • Rejects with unknownModule when a flowConfig entry names a module that the SDK does not recognize, and with Incd::StartOnboardingException for other flow configuration errors.
  • If the SDK cannot add a Phone, Email, or FullName step from its configuration, it logs Module <name> was not added: <reason>, omits the step, and the flow continues.

Example

const result = await IncodeSdk.startOnboarding({
  sessionConfig: {
    configurationId: 'YOUR_CONFIGURATION_ID',
  },
  flowConfig: [
    { module: 'IdScan' },
    { module: 'SelfieScan' },
    { module: 'FaceMatch' },
  ],
});

setupOnboardingSession

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

Signature

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

Optional Parameters

  • sessionConfig: Session configuration. Provide token or interviewId to attach to a backend-created session. No key is required; omit it to create a session with the SDK defaults.

Returns / Callbacks

  • Returns Promise<OnboardingSession>. Both keys are optional; a key is omitted when the SDK has no value.
  • interviewId: Unique identifier of the onboarding session. iOS returns none when the session is resumed with a token.
  • token: Token created for this onboarding session. Present on every success outside submitOnly mode. In submitOnly mode iOS returns none, while the Android SDK still creates a session and returns one.
  • Rejects with an IncodeSdkFlowError code, the same on Android and iOS:
    • configError: sessionConfig is present but is not an object.
    • sectionAlreadyRunning: A startOnboardingSection call is still running.
    • sslPinningFailed: SSL pinning failed.
    • integrityCompromised: iOS only. The device integrity check failed. On Android, the same cause is reported as sessionCreationFailed.
    • sessionCreationFailed: The session could not be created. Examples include: after a server or HTTP error, a revoked API key, or the SDK finished without a token outside submitOnly mode.
    • unknown: The SDK is not initialized. This is the only cause of unknown for this method on either platform.
  • Each call creates a new session, unless sessionConfig resumes one with token or interviewId.
  • On Android, token must be a session token created by your back end. The Android SDK sends it without the API key, so the token of a session that the SDK created itself, such as by an earlier setupOnboardingSession call, is rejected with sessionCreationFailed (HTTP 403). iOS resumes both kinds of token.

Example

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

console.log(session.interviewId ?? 'no interviewId (iOS token resume)', session.token);

startOnboardingSection

Starts one section in a section-based flow.

Signature

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

Required Parameters

  • sectionTag: Unique identifier for the section you want to start. It must be a non-blank string. If it is missing or blank, the call rejects with configError.

Optional Parameters

  • flowConfig: Ordered list of modules for this section. startOnboardingSection accepts the same modules as startOnboarding; see Modules.
  • recordSessionConfig: Optional recording configuration for ID and Selfie capture, of type OnboardingSectionRecordSessionConfig. The key is forcePermission (singular). startOnboarding still uses OnboardingRecordSessionConfig with forcePermissions. If the value is not an object, the call rejects with configError.

Returns / Callbacks

  • Returns Promise<OnboardingSectionResponse>.
  • status: success. A cancelled section rejects with code: 'userCancelled'.
  • sectionTag: Value of the sectionTag parameter passed in config.
  • Rejects with unknownModule when a flowConfig entry names a module that the SDK does not recognize, and with configError for other configuration errors, such as a missing or blank sectionTag.
  • Rejects with sectionAlreadyRunning when you call it while another section is running. The running section is not affected.
  • Rejects with noActiveSession when no onboarding session is set up.
  • If the SDK cannot add a Phone, Email, or FullName step from its configuration, it logs Module <name> was not added: <reason>, leaves the step out, and the flow continues.
  • Rejects with activityNotPresent when no activity (Android) or view controller (iOS) is present.

Example

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 finishOnboarding() after all sections complete.

finishOnboarding

Finishes the current section-based onboarding session.

Call getUserScore and approve before finishOnboarding(): on iOS, finishing ends the session, so they reject afterwards. Call deleteLocalUserData only after it resolves.

Signature

IncodeSdk.finishOnboarding(): Promise<{ success: true }>

Parameters

  • None.

Returns / Callbacks

  • Resolves with { success: true } after the session is finished.
  • Rejects with an error whose code is an IncodeSdkFlowErrorCode:
    • sectionAlreadyRunning: An onboarding section is still running. Wait for its result, then call finishOnboarding.
    • noActiveSession: There is no onboarding session. On Android, it is detected only before the first session on the device or after deleteLocalUserData.
    • finishOnboardingFailed: The SDK is not initialized, or the server call failed. message carries the native detail.
    • sslPinningFailed (Android only) and integrityCompromised (iOS only).
    • Android only: methodNotSupportedByBridge or bridgeFailure when the installed Hybrid Bridge is incompatible.
  • There is no cancellation: finishing has no UI.
  • Calling finishOnboarding a second time behaves differently per platform: on Android, the SDK keeps the session after finishing, so the second call reaches the server again; on iOS, it rejects with noActiveSession.

Example

try {
  await IncodeSdk.finishOnboarding();
} catch (e: any) {
  console.log('finishOnboarding failed', e.code, e.message);
}

startFlow

Starts a Dashboard-configured flow.

Signature

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 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 below.

Returns / Callbacks

  • Returns Promise<OnboardingResponse>.
  • Resolves with { status: 'success' }. Rejects with code: 'userCancelled' when the user cancels.
  • Rejects with IncodeSdkFlowError.

Example

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

Valid moduleId values

moduleId values correspond to the modules documented in Modules, 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
FullName NAME_CAPTURE
CurpValidation 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

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

Required Parameters

  • sessionConfig.configurationId or sessionConfig.token: the configuration ID of a workflow on Dashboard, or an external session token from your backend. At least one must be a non-empty string; interviewId alone is not enough.

Optional Parameters

Returns / Callbacks

  • Returns Promise<OnboardingResponse>.
  • Resolves with { status: 'success' }. Rejects with code: 'userCancelled' when the user cancels.
  • Rejects with IncodeSdkFlowError. Rejects with code: 'configError' and the message configurationId or token is required to start a workflow when neither is set. This happens before the flow starts, and no network request is made.

Example

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

Starts a flow from a deep link URL.

Signature

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

Example

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

onSessionCreated

Subscribes to onboarding session creation events.

Signature

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

Required Parameters

Returns / Callbacks

  • Returns an unsubscriber function.
  • Listener receives interviewId and token. Each key is omitted when the SDK has no value; the payload is the same on Android and iOS.

Example

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

onStepCompleted

Subscribes to step completion events for a specific module.

Signature

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.

Example

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

onStepUpdated

Subscribes to in-progress step update events.

Signature

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

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

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.

Example

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

onEvents

Subscribes to tracking events.

Signature

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

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

IncodeSdk.approve(args?: {
  forceApproval?: boolean;
}): Promise<ApprovalResult>

Optional Parameters

  • forceApproval: If true, the user will be force-approved. Defaults to false.

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 success, uuid, customerToken, and error.
  • success reports whether the user was approved. A false value is a normal, expected outcome, not an error.
  • uuid, customerToken, and error are null when the SDK has no value for them. error is iOS only and is always null on Android.
  • Rejects on failure with userCancelled, approvalError (Android only), or an IncodeSdkFlowErrorCode value. On Android, it also rejects with methodNotSupportedByBridge when the installed native bridge has no handler for approve, and with bridgeFailure when the native call throws.

Example

IncodeSdk.approve({ forceApproval: false })
  .then(({ success, uuid, customerToken }) => {
    console.log('approve finished: ', success, uuid, customerToken);
  })
  .catch((error) => {
    console.log('approve error: ', error);
  });

getUserScore

Fetches the current user score programmatically.

Signature

IncodeSdk.getUserScore(config?: {
  fetchMode?: 'accurate' | 'fast';
  interviewId?: string;
}): Promise<UserScoreResult>

Optional Parameters

  • fetchMode: accurate or fast. Defaults to accurate. accurate fetches server-side results and can take longer; fast uses on-device processing.
  • interviewId: the interview to score. Omit to score the current session.

Returns / Callbacks

  • Returns Promise<UserScoreResult> — the full score surface. See Results.
  • Rejects with userScoreFailed when the score could not be fetched.

Example

IncodeSdk.getUserScore({ fetchMode: '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

IncodeSdk.faceMatch(config?: {
  interviewId?: string;
  matchType?: 'idSelfie' | 'nfcSelfie' | 'nfc3Way';
  idCategory?: 'primary' | 'secondary';
}): Promise<FaceMatchResult>

Parameters

  • interviewId (optional): defaults to the current session's interview.
  • matchType (optional): one of idSelfie, nfcSelfie, nfc3Way. Omit for the native SDK default.
  • idCategory (optional): primary or secondary. Defaults to primary.

Returns / Callbacks

  • Returns Promise<FaceMatchResult>:
interface FaceMatchResult {
  confidence?: number;
  existingInterviewId?: string;
  idCategory: 'primary' | 'secondary';   // always present
  isExistingUser?: boolean;
  isFaceMatched?: boolean;
  isNameMatched?: boolean;
  nfcVsIdConfidence?: number;
  nfcVsSelfieConfidence?: number;
  secondIdConfidence?: number;
}
  • Apart from idCategory, a field is present only when the native SDK produced a value — omitted, not defaulted, and without rejecting. An absent isFaceMatched means no comparison was possible (e.g. no ID uploaded), which is distinct from a confirmed mismatch. On Android the booleans are non-nullable natively and always present; write cross-platform code against the iOS behavior and test for presence rather than truthiness.
  • There is no status field — derive it from isFaceMatched. This result is identical to what the Flutter and Cordova SDKs return for the same call. The FaceMatch module event (FaceMatchCompleteEvent, from startOnboarding/startFlow) is a separate path with its own shape, and does report status.
  • Rejects with an error.code of:
code Meaning Platforms
faceMatchError Any native failure. error.message carries the native detail. both
userCancelled The user dismissed the operation. Android only — iOS has no distinct cancellation signal, so a cancellation there rejects with faceMatchError.
methodNotSupportedByBridge The installed native bridge has no handler for this method — the native dependency is older than the JS layer. Android only
bridgeFailure The native call threw before producing a result. Android only

Treat userCancelled as an optional refinement of faceMatchError, not a separate branch you must guard by platform. Handling both unconditionally works everywhere — the userCancelled check simply never matches on iOS:

.catch((error) => {
  if (error.code === 'userCancelled') return;   // never fires on iOS
  showError(error.message);                     // covers faceMatchError
});
  • Runs silently in the background, compared to the regular FaceMatch module that shows UI feedback to the user.

Example

IncodeSdk.faceMatch({ idCategory: 'primary' })
  .then((result) => {
    if (result.isFaceMatched === undefined) {
      console.log('No comparison was possible');
    } else {
      console.log('Matched:', result.isFaceMatched, 'confidence:', result.confidence);
    }
  })
  .catch((error) => {
    if (error.code === 'userCancelled') return;
    console.error('Face match failed', error.code, error.message);
  });

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

IncodeSdk.startFaceLogin(args?: {
  showTutorials?: boolean;
  customerUUID?: string;
  faceAuthMode?: 'server' | 'local';
  faceAuthModeFallback?: boolean;
  faceMaskCheck?: boolean;
  lensesCheck?: boolean;
  logAuthenticationEnabled?: boolean;
  recognitionThreshold?: number;
  spoofThreshold?: number;
  waitForTutorials?: boolean;
  e2eEncryptionEnabled?: boolean;
}): Promise<FaceLoginResult>

Parameters

Every parameter is optional. An omitted parameter uses the native SDK default. The plugin sets no value of its own.

  • showTutorials: Show tutorials before Face Login. Default: native default.
  • customerUUID: Required for 1:1 Face Login. Omit for 1:N database lookup.
  • faceAuthMode: server or local. Default: native default. local requires the Face Login (-l) SDK variant. Any other value is ignored.
  • faceAuthModeFallback: Fall back to server when local has no stored face template. Only used with customerUUID and faceAuthMode: 'local'. Default: native default.
  • faceMaskCheck: Specify true to prevent login for users wearing a face mask. Default: native default.
  • lensesCheck: Specify whether the SDK should check for lenses/glasses. Default: native default.
  • logAuthenticationEnabled: Enable authentication logging. Default: native default.
  • recognitionThreshold: Face recognition threshold. This is an SDK-wide setting that stays in effect for later SDK calls, and on iOS across app launches.
  • spoofThreshold: Spoof detection threshold. SDK-wide, like recognitionThreshold.
  • waitForTutorials: Wait for the tutorial animation to finish before capture starts. Default: native default. On iOS, this is an SDK-wide setting; the SDK restores the previous value when the call ends.
  • e2eEncryptionEnabled: Enable end-to-end encryption (E2EE) for the authentication flow. Android only; ignored on iOS, where E2EE is configured at initialize through e2eeUrl.

Returns / Callbacks

  • Returns Promise<FaceLoginResult>.
  • Response fields are documented in Results.
  • A login that completed without a match (face not recognized, spoof, or blocklisted user) resolves with faceMatched: false. It does not reject.
  • Rejects with the native module's error, not an IncodeSdkFaceLoginError instance, so instanceof IncodeSdkFaceLoginError is always false. Match on error.code, typed as IncodeSdkFaceLoginErrorCode, which is one of:
Code Meaning
userCancelled The user closed the flow.
permissionsDenied The camera permission was denied.
faceLoginError Any other native failure. error.message carries the native detail. On iOS, this includes capture preconditions such as lensesDetected, faceMaskDetected, tooDark, and noFaceTemplateStored.
faceLoginInProgress Another startFaceLogin call has not settled yet: for example, after a double tap or a quick retry. The running login continues.
activityNotPresent There is no foreground Activity (Android) or presenting view controller (iOS) to launch the flow from.
methodNotSupportedByBridge Android only. The installed Hybrid Bridge has no startFaceLogin handler, which indicates an incompatible native dependency version.
bridgeFailure Android only. The bridge call, or the conversion of its result, threw. This usually indicates a native SDK version mismatch. error.message carries the detail.

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.

const result = await IncodeSdk.startFaceLogin({
  showTutorials: true,
  customerUUID: 'YOUR_CUSTOMER_UUID',
  faceMaskCheck: false,
  lensesCheck: false,
  logAuthenticationEnabled: false,
  e2eEncryptionEnabled: 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.

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

To enable faceMaskCheck on Android, add:

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

deleteLocalUserData

Deletes locally stored onboarding session data on Android devices.

Signature

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

await IncodeSdk.deleteLocalUserData();

showCloseButton

Shows or hides the close button during SDK flows.

Signature

IncodeSdk.showCloseButton(
  allowUserToCancel: boolean
): Promise<void>

Required Parameters

  • allowUserToCancel: Set to true to show the close button, or false to hide it.

Returns / Callbacks

  • Returns Promise<void>.
  • Rejects with appearanceError if allowUserToCancel is missing.
  • When the user presses the close button, the flow is aborted.

Example

IncodeSdk.showCloseButton(true);

setLocalizationLanguage

Sets runtime localization language.

Signature

IncodeSdk.setLocalizationLanguage(
  language: string
): Promise<void>

Required Parameters

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

Returns / Callbacks

  • Returns Promise<void>.
  • Rejects with appearanceError if applying the language fails. Omitted or unsupported values fall back to en and do not reject.

Example

await IncodeSdk.setLocalizationLanguage('en');

Android requires:

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

setString

Sets and updates string resources at runtime.

Signature

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

Required Parameters

  • strings: Map of string keys and values.

Returns / Callbacks

  • Returns Promise<void>.
  • Rejects with appearanceError if strings is missing or any value is not a string.

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

Example

For iOS:

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

For Android:

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

Android requires:

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

For iOS, see Localization Guide. For Android, see Dynamic Localization.

setQuantityStrings

Android only. This method has no effect on iOS.

Sets Android plural strings at runtime.

Signature

IncodeSdk.setQuantityStrings(
  locale: string,
  quantityStrings: { [key: string]: any }
): Promise<void>

Required Parameters

  • locale: A BCP 47 language tag such as "en", "es", or "en-US".
  • quantityStrings: Map of plural string keys to plural values. Shaped as plural name → quantity keyword → value.

Returns / Callbacks

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

Example

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

setTheme

Applies a JSON theme.

Signature

IncodeSdk.setTheme({
  theme: string;
}): Promise<void>

Required Parameters

  • theme: JSON string containing theme configuration.

Returns / Callbacks

  • Returns Promise<void>.
  • Rejects with appearanceError if the theme JSON is missing or invalid.

Example

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

setUXConfig

Applies UX configuration for V2 ID scan and Selfie experiences.

Signature

IncodeSdk.setUXConfig({
  jsonConfig: string;
}): Promise<void>

Required Parameters

  • jsonConfig: JSON string containing UX configuration.

Returns / Callbacks

  • Returns Promise<void>.
  • Rejects with appearanceError if jsonConfig is missing.

Example

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 and iOS.

setFaceAuthenticationHint

Provides a face authentication hint for the FaceAuthentication module.

Signature

IncodeSdk.setFaceAuthenticationHint({
  identityId: string;
}): Promise<void>

Required Parameters

  • identityId: Identity id used as the face authentication hint.

Returns / Callbacks

  • Returns Promise<void>.
  • Rejects with appearanceError if identityId is missing.

Example

await IncodeSdk.setFaceAuthenticationHint({
  identityId: 'customer@example.com',
});

Sets a custom logo for the SDK screens. The logo shows on every UX V2 screen, such FaceAuthentication, and on the UX V1 (legacy) screens. Call it after initialize and before you start a flow.

A logo set on the SelfieScan module or the VideoSelfie module has priority in that module.

Signature

IncodeSdk.setLogo({
  logo: string;
}): Promise<void>

Required Parameters

  • logo: Name of an image of your app. Use the same name on both platforms.
    • Android: A drawable resource name (res/drawable/<name>). On V2 screens, use a vector drawable or a raster image (PNG, JPG, or WebP). V2 screens do not support other XML drawables, such as layer-list, selector, or shape. On legacy screens, the logo requires the Android extensions dependency.
    • iOS: An image asset name from your asset catalog or main bundle.

Returns / Callbacks

  • Returns Promise<void>.
  • Rejects with appearanceError if logo is missing, or if the name does not match an image of your app. The SDK then keeps its current logo.

Example

await IncodeSdk.setLogo({ logo: 'my_logo' });

Android: keep the drawable in release builds

On Android, the logo is a drawable resource of your app. The SDK finds it by name at runtime, so no code refers to it. When resource shrinking is on (shrinkResources true), the Android shrinker removes the drawable from release builds. setLogo then works in debug builds but rejects with appearanceError in release builds. To keep the drawable, add it to res/raw/keep.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"
    tools:keep="@drawable/my_logo" />

onResourceDownloadProgressUpdated

Subscribes to Dynamic Delivery resource download progress.

Signature

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

Required Parameters

  • listener: Callback invoked with download progress.

Returns / Callbacks

  • Returns an unsubscriber function.

Example

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

checkOnDemandResourcesDownloaded

Checks whether Dynamic Delivery resources are already downloaded.

Signature

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

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

downloadOnDemandResources

Downloads Dynamic Delivery resources.

Signature

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

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

removeOnDemandResources

Removes Dynamic Delivery resources.

Signature

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

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

Shared types

Common types used by multiple API methods.

Signature

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

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

type OnboardingSectionRecordSessionConfig = {
  recordSession?: boolean;
  forcePermission?: boolean;
};

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

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

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

OnboardingSessionConfig Fields

  • region: Deprecated. No method reads it; both native SDKs detect the region automatically.
  • 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. Unknown names are skipped. Supported values include:
    • id
    • secondId
    • liveness
    • faceRecognition
    • faceRecognitionSecondId
    • faceMask
    • governmentValidation
    • governmentFaceValidation
    • governmentOcrValidation
    • videoSelfie
    • videoSelfieLiveness
    • videoSelfieOcr
    • videoSelfieIdType
    • videoSelfieSpeech
    • videoSelfieBackIdType
    • videoSelfieBackIdOcr
    • incodeWatchlist
    • addressFieldPoAValidation
    • dateFieldPoAValidation (Android only)
  • customFields: Custom data attached to this onboarding session.
  • downloadImagesEnabled: Download the session images when resuming an interview. Default is true.
  • 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

Used by startOnboarding.

  • 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.

OnboardingSectionRecordSessionConfig Fields

Used by startOnboardingSection. Both fields are optional and default to false. Omit the object to record nothing.

  • recordSession: Set to true to enable ID and Selfie capture screen recording.
  • forcePermission: Set to true to abort the section if the user denies permissions, or false otherwise.

Was this page helpful?