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 totrueif running on simulators/emulators,falsewhen running on devices. Default isfalse.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: Specifystandard,captureOnly, orsubmitOnly. Default isstandard.captureOnlyworks completely offline and for ID and Selfie scan only captures images without validations.submitOnlysubmits previously captured data without performing new captures.sslPinningConfig.enabled: Set totrueto enable SSL pinning,falseotherwise.sslPinningConfig.forceSSLPinning: Set totrueto force SSL pinning. Default isfalsewhen omitted.externalAnalyticsEnabled: Set totrueto enable external analytics. Default istrue.loggingEnabled: Set totrueto enable logging. Default istrue.externalScreenshotsEnabled: Set totrueto enable external screenshots. Default isfalse.clientExperimentId: Used to enroll the customer into specific SDK experiences. PassexperimentV2to 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 istruewhen omitted.
Returns / Callbacks
- Returns
Promise<void>when initialization succeeds. - Rejects with
IncodeSdkInitError. Exportedcodevalues are:simulatorDetected: running on a simulator without passingtestMode: true.testModeEnabled:testMode: truewas 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/urlis 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 totrueif the native SDK is initialized, otherwisefalse.
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 ofstandard,captureOnly, orsubmitOnly.
Returns / Callbacks
- Returns
Promise<void>. - Rejects if
sdkModeis 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 region, queue, Dashboard configuration, backend-createdinterviewId/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. Exportedcodevalues includepermissionsDenied,videoSelfieNotCompleted,integrityCompromised,faceAuthenticationFailed,sslPinningFailed,locationUnavailable,storageUnavailable,combinedConsentsNotReceived,userCancelled,interrupted,biometricConsentNotGiven,biometricConsentNotReceived,configError(startWorkflowonly) andunknown. See the error enums for the full list and platform notes. - Rejects with
unknownModulewhen aflowConfigentry names a module that the SDK does not recognize, and withIncd::StartOnboardingExceptionfor other flow configuration errors. - If the SDK cannot add a
Phone,Email, orFullNamestep from its configuration, it logsModule <name> was not added: <reason>, omits the step, and the flow continues.
Example
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
IncodeSdk.setupOnboardingSession({
sessionConfig?: OnboardingSessionConfig;
}): Promise<OnboardingSession>
Optional Parameters
sessionConfig: Session configuration. ProvidetokenorinterviewIdto 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
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
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 withconfigError.
Optional Parameters
flowConfig: Ordered list of modules for this section.startOnboardingSectionaccepts the same modules asstartOnboarding; see Modules.recordSessionConfig: Optional recording configuration for ID and Selfie capture, of typeOnboardingSectionRecordSessionConfig. The key isforcePermission(singular).startOnboardingstill usesOnboardingRecordSessionConfigwithforcePermissions. If the value is not an object, the call rejects withconfigError.
Returns / Callbacks
- Returns
Promise<OnboardingSectionResponse>. status:success. A cancelled section rejects withcode: 'userCancelled'.sectionTag: Value of thesectionTagparameter passed in config.- Rejects with
unknownModulewhen aflowConfigentry names a module that the SDK does not recognize, and withconfigErrorfor other configuration errors, such as a missing or blanksectionTag. - Rejects with
sectionAlreadyRunningwhen you call it while another section is running. The running section is not affected. - Rejects with
noActiveSessionwhen no onboarding session is set up. - If the SDK cannot add a
Phone,Email, orFullNamestep from its configuration, it logsModule <name> was not added: <reason>, leaves the step out, and the flow continues. - Rejects with
activityNotPresentwhen 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 finishOnboardingFlow() after all sections complete.
finishOnboardingFlow
Finishes the current section-based onboarding session.
Signature
IncodeSdk.finishOnboardingFlow(): Promise<any>
Parameters
- None.
Returns / Callbacks
- Returns a promise that resolves after the current section-based onboarding session is finished.
Example
await IncodeSdk.finishOnboardingFlow();
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 bystartOnboarding.moduleId: Module name to start the flow from, for exampleEMAILorPHONE. If omitted, the flow starts from the first module in the configuration. See validmoduleIdvalues below.
Returns / Callbacks
- Returns
Promise<OnboardingResponse>. - Resolves with
{ status: 'success' }. Rejects withcode: '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 |
|
| 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.configurationIdorsessionConfig.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;interviewIdalone is not enough.
Optional Parameters
sessionConfig: Same session configuration shape used bystartOnboarding.
Returns / Callbacks
- Returns
Promise<OnboardingResponse>. - Resolves with
{ status: 'success' }. Rejects withcode: 'userCancelled'when the user cancels. - Rejects with
IncodeSdkFlowError. Rejects withcode: 'configError'and the messageconfigurationId or token is required to start a workflowwhen 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',
},
});
startFlowFromDeepLink
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 tofalse.
Returns / Callbacks
- Returns
Promise<OnboardingResponse>. - Rejects with
IncodeSdkFlowError.
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
listener: Callback that receivesOnboardingSession.
Returns / Callbacks
- Returns an unsubscriber function.
- Listener receives
interviewIdandtoken.
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, orSelfieScan.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, andSelfieScan.
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: Iftrue, the user will be force-approved. Defaults tofalse.
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, anderror. successreports whether the user was approved. Afalsevalue is a normal, expected outcome, not an error.uuid,customerToken, anderrorarenullwhen the SDK has no value for them.erroris iOS only and is alwaysnullon Android.- Rejects on failure with
userCancelled,approvalError(Android only), or anIncodeSdkFlowErrorCodevalue. On Android, it also rejects withmethodNotSupportedByBridgewhen the installed native bridge has no handler forapprove, and withbridgeFailurewhen 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:accurateorfast. Defaults toaccurate.accuratefetches server-side results and can take longer;fastuses 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
userScoreFailedwhen 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 ofidSelfie,nfcSelfie,nfc3Way. Omit for the native SDK default.idCategory(optional):primaryorsecondary. Defaults toprimary.
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 absentisFaceMatchedmeans 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
statusfield — derive it fromisFaceMatched. This result is identical to what the Flutter and Cordova SDKs return for the same call. TheFaceMatchmodule event (FaceMatchCompleteEvent, fromstartOnboarding/startFlow) is a separate path with its own shape, and does reportstatus. - Rejects with an
error.codeof:
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
FaceMatchmodule 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({
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: Specifytrueto 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.
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,
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.
const result = await IncodeSdk.startFaceLogin({
showTutorials: true,
faceMaskCheck: false,
lensesCheck: false,
logAuthenticationEnabled: false,
e2eeEncryptionEnabled: 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 totrueto show the close button, orfalseto hide it.
Returns / Callbacks
- Returns
Promise<void>. - Rejects with
appearanceErrorifallowUserToCancelis 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 currentlyen,es, andpt.
Returns / Callbacks
- Returns
Promise<void>. - Rejects with
appearanceErrorif applying the language fails. Omitted or unsupported values fall back toenand 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
appearanceErrorifstringsis 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 asplural 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
appearanceErrorif 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
appearanceErrorifjsonConfigis 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
appearanceErrorifidentityIdis missing.
Example
await IncodeSdk.setFaceAuthenticationHint({
identityId: 'customer@example.com',
});
setLogo
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 aslayer-list,selector, orshape. On legacy screens, the logo requires the Android extensions dependency. - iOS: An image asset name from your asset catalog or main bundle.
- Android: A drawable resource name (
Returns / Callbacks
- Returns
Promise<void>. - Rejects with
appearanceErroriflogois 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[];
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: Region, currentlyALL(covers all regions),BR(optimized for Brazil), orIN(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 forVideoSelfievoice consent. Supported values are currentlyen,es,pt, andhe.
OnboardingRecordSessionConfig Fields
Used by startOnboarding.
recordSession: Set totrueto enable ID and Selfie capture screen recording.forcePermissions: Set totrueto abort the session if the user denies permissions, orfalseotherwise.
OnboardingSectionRecordSessionConfig Fields
Used by startOnboardingSection. Both fields are optional and default to false. Omit the object to record nothing.
recordSession: Set totrueto enable ID and Selfie capture screen recording.forcePermission: Set totrueto abort the section if the user denies permissions, orfalseotherwise.