API Reference
This is the complete reference for every public API exposed by the SDK.
init
Initializes the native Incode SDK. Must be called at least once per app lifecycle before any other operation.
Signature
IncodeOnboardingSdk.init({
bool loggingEnabled = true,
String? apiKey,
String? apiUrl,
String? e2eeUrl,
bool? testMode,
bool? waitForTutorials,
bool? disableJailbreakDetection,
bool? externalAnalyticsEnabled,
bool? externalScreenshotsEnabled,
String? clientExperimentId,
bool? sslPinningEnabled,
bool? forceSSLPinning,
required Function() onSuccess,
required Function(String error) onError,
})Optional Parameters
loggingEnabled: If set totrue, the SDK will log debug information to the console. Default istrue.apiKey: API key provided by Incode.apiUrl: API base URL provided by Incode.e2eeUrl: E2EE base URL provided by Incode.testMode: If you're running the app on a simulator, please set this parameter totrue.waitForTutorials: If set totrue, the SDK will wait for the user to complete the tutorials before starting the onboarding flow. Default isfalse.disableJailbreakDetection: If set totrue, the SDK will not check for jailbreak/rooted devices. Default isfalse.externalAnalyticsEnabled: If set totrue, the SDK will send analytics events to the external analytics provider. Default isfalse.externalScreenshotsEnabled: If set totrue, the SDK will allow screenshots to be taken. Default isfalse.clientExperimentId: If set, the SDK will send this value to the server to be used for A/B testing. Default isnull.sslPinningEnabled: If set totrue, the SDK will enable SSL pinning. Default isfalse.forceSSLPinning: If set totrue, the SDK will force SSL pinning even if the server does not support it. Default isfalse.
Returns / Callbacks
onSuccess: Callback function to be called when the SDK is initialized successfully.onError: Callback function to be called in case initialization is not successful.
Example
IncodeOnboardingSdk.init(
apiKey: 'YOUR_API_KEY',
apiUrl: 'YOUR_API_URL',
testMode: false,
onError: (String error) {
print('Incode init failed: $error');
},
onSuccess: () {
print('Incode initialized successfully!');
},
);isInitialized
Use isInitialized to check whether the native Incode SDK has finished initialization. The method never throws — any platform error is handled internally and reported as false, so it is safe to use as a quick readiness check before starting a flow.
Signature
Future<bool> IncodeOnboardingSdk.isInitialized()Returns / Callbacks
- Returns a
Future<bool>that resolves totruewhen the SDK is ready to be used, andfalseotherwise.
Example
final bool ready = await IncodeOnboardingSdk.isInitialized();
if (ready) {
// Safe to start onboarding
}startOnboarding
Creates a session and runs a complete, locally-defined flow end to end.
Signature
IncodeOnboardingSdk.startOnboarding({
required OnboardingSessionConfiguration sessionConfig,
required OnboardingFlowConfiguration flowConfig,
OnboardingRecordSessionConfiguration? recordSessionConfig,
required Function() onSuccess,
required Function(String error) onError,
Function(SelfieScanResult result)? onSelfieScanCompleted,
Function(SelfieScanResult result)? onSelfieScanAttemptCompleted,
Function(FaceMatchResult result)? onFaceMatchCompleted,
Function(GeoLocationResult result)? onGeolocationCompleted,
Function(PhoneNumberResult result)? onAddPhoneNumberCompleted,
Function(VideoSelfieResult result)? onVideoSelfieCompleted,
Function(OnboardingSessionResult result)? onOnboardingSessionCreated,
Function(ApprovalResult result)? onApproveCompleted,
Function(UserScoreResult result)? onUserScoreFetched,
Function(GovernmentValidationResult result)? onGovernmentValidationCompleted,
Function(AntifraudResult result)? onAntifraudCompleted,
Function(DocumentScanResult result)? onDocumentScanCompleted,
Function(SignatureResult result)? onSignatureCollected,
Function(CaptchaResult result)? onCaptchaCompleted,
Function(CurpValidationResult result)? onCurpValidationCompleted,
Function(OCREditResult result)? onOCREditCompleted,
Function(EKYBResult result)? onEKYBCompleted,
Function(EKYCResult result)? onEKYCCompleted,
Function(IdScanResult result)? onIdFrontCompleted,
Function(IdScanResult result)? onIdBackCompleted,
Function(IdScanResult result)? onIdFrontAttemptCompleted,
Function(IdScanResult result)? onIdBackAttemptCompleted,
Function(String ocrData)? onIdProcessed,
Function(AddEmailResult result)? onAddEmailCompleted,
Function(AddFullNameResult result)? onAddFullNameCompleted,
Function(MLConsentResult result)? onMLConsentCompleted,
Function(CustomWatchlistResult result)? onCustomWatchlistCompleted,
Function(AesResult result)? onAesCompleted,
Function(UserConsentResult result)? onUserConsentCompleted,
Function(QRScanResult result)? onQRScanCompleted,
Function(GlobalWatchlistResult result)? onGlobalWatchlistCompleted,
Function(CombinedConsentResult result)? onCombinedConsentCompleted,
Function(NFCScanResult result)? onNFCScanCompleted,
Function(FaceAuthenticationResult result)? onFaceAuthenticationCompleted,
Function()? onSSLPinningFailed,
Function(OnEventsResult result)? onEvents,
Function()? onUserCancelled,
})Required Parameters
sessionConfig: AnOnboardingSessionConfigurationobject that contains the configuration for the onboarding session.flowConfig: AnOnboardingFlowConfigurationobject that contains the configuration for the onboarding flow.
Optional Parameters
recordSessionConfig: An optionalOnboardingRecordSessionConfigurationobject that contains the configuration for recording the onboarding session.
You can also provide these optional parameters to the OnboardingSessionConfiguration object constructor:
- region:
ALLby default - onboardingValidationModules: list of
OnboardingValidationModuleitems. This list determines which modules are used for verification and calculation of the onboarding score. If you pass null as validationModuleList, the default values will be used: id, faceRecognition and liveness. - customFields: custom fields which are sent to the server.
- externalId: User identifier outside of Incode Omni database.
- externalCustomerId: This identifier links the onboarding session to an entity in an external system not part of the Incode Omni Platform. It could represent a prospect ID or a customer ID from the client's database, providing a bridge between the Incode session and the client's internal user management systems.
- interviewId: Unique identifier of an existing session.
- token: Token of an existing session.
- configurationId: Flow configurationId found on Incode dashboard.
- e2eEncryptionEnabled: Enable e2e encryption.
Specifying interviewId or token will return an existing session that will be resumed.
Specifying externalId will return an existing session in case a session with the same externalId was already started, otherwise new session will be created.
Returns / Callbacks
onSuccess: Callback function to be called when the onboarding flow is completed successfully.onError: Callback function to be called in case an error occurs during the onboarding flow. Theerrorparameter will contain a string describing the error.onSelfieScanCompleted: Optional callback function to be called when the selfie scan is completed. Theresultparameter will contain aSelfieScanResultobject with the result of the selfie scan.onSelfieScanAttemptCompleted: Optional callback function to be called when the selfie scan attempt is completed. Theresultparameter will contain aSelfieScanResultobject with the result of the selfie scan attempt.onFaceMatchCompleted: Optional callback function to be called when the face match is completed. Theresultparameter will contain aFaceMatchResultobject with the result of the face match.onGeolocationCompleted: Optional callback function to be called when the geolocation is completed. Theresultparameter will contain aGeoLocationResultobject with the result of the geolocation.onAddPhoneNumberCompleted: Optional callback function to be called when the phone number is added. Theresultparameter will contain aPhoneNumberResultobject with the result of the phone number addition.onVideoSelfieCompleted: Optional callback function to be called when the video selfie is completed. Theresultparameter will contain aVideoSelfieResultobject with the result of the video selfie.onOnboardingSessionCreated: Optional callback function to be called when the onboarding session is created. Theresultparameter will contain anOnboardingSessionResultobject with the result of the onboarding session creation.onApproveCompleted: Optional callback function to be called when the approval is completed. Theresultparameter will contain anApprovalResultobject with the result of the approval.onUserScoreFetched: Optional callback function to be called when the user score is fetched. Theresultparameter will contain aUserScoreResultobject with the result of the user score fetch.onGovernmentValidationCompleted: Optional callback function to be called when the government validation is completed. Theresultparameter will contain aGovernmentValidationResultobject with the result of the government validation.onAntifraudCompleted: Optional callback function to be called when the antifraud check is completed. Theresultparameter will contain anAntifraudResultobject with the result of the antifraud check.onDocumentScanCompleted: Optional callback function to be called when the document scan is completed. Theresultparameter will contain aDocumentScanResultobject with the result of the document scan.onSignatureCollected: Optional callback function to be called when the signature is collected. Theresultparameter will contain aSignatureResultobject with the result of the signature collection.onCaptchaCompleted: Optional callback function to be called when the captcha is completed. Theresultparameter will contain aCaptchaResultobject with the result of the captcha.onCurpValidationCompleted: Optional callback function to be called when the CURP validation is completed. Theresultparameter will contain aCurpValidationResultobject with the result of the CURP validation.onOCREditCompleted: Optional callback function to be called when the OCR edit is completed. Theresultparameter will contain anOCREditResultobject with the result of the OCR edit.onEKYBCompleted: Optional callback function to be called when the EKYB is completed. Theresultparameter will contain anEKYBResultobject with the result of the EKYB.onEKYCCompleted: Optional callback function to be called when the EKYC is completed. Theresultparameter will contain anEKYCResultobject with the result of the EKYC.onIdFrontCompleted: Optional callback function to be called when the front ID scan is completed. Theresultparameter will contain anIdScanResultobject with the result of the front ID scan.onIdBackCompleted: Optional callback function to be called when the back ID scan is completed. Theresultparameter will contain anIdScanResultobject with the result of the back ID scan.onIdFrontAttemptCompleted: Optional callback function to be called when the front ID scan attempt is completed. Theresultparameter will contain anIdScanResultobject with the result of the front ID scan attempt.onIdBackAttemptCompleted: Optional callback function to be called when the back ID scan attempt is completed. Theresultparameter will contain anIdScanResultobject with the result of the back ID scan attempt.onIdProcessed: Optional callback function to be called when the ID is processed. TheocrDataparameter will contain a string with the OCR data of the ID.onAddEmailCompleted: Optional callback function to be called when the email is added. Theresultparameter will contain anAddEmailResultobject with the result of the email addition.onAddFullNameCompleted: Optional callback function to be called when the full name is added. Theresultparameter will contain anAddFullNameResultobject with the result of the full name addition.onMLConsentCompleted: Optional callback function to be called when the ML consent is completed. Theresultparameter will contain anMLConsentResultobject with the result of the ML consent.onCustomWatchlistCompleted: Optional callback function to be called when the custom watchlist check is completed. Theresultparameter will contain aCustomWatchlistResultobject with the result of the custom watchlist check.onAesCompleted: Optional callback function to be called when the AES check is completed. Theresultparameter will contain anAesResultobject with the result of the AES check.onUserConsentCompleted: Optional callback function to be called when the user consent is completed. Theresultparameter will contain aUserConsentResultobject with the result of the user consent.onQRScanCompleted: Optional callback function to be called when the QR scan is completed. Theresultparameter will contain aQRScanResultobject with the result of the QR scan.onGlobalWatchlistCompleted: Optional callback function to be called when the global watchlist check is completed. Theresultparameter will contain aGlobalWatchlistResultobject with the result of the global watchlist check.onCombinedConsentCompleted: Optional callback function to be called when the combined consent is completed. Theresultparameter will contain aCombinedConsentResultobject with the result of the combined consent.onNFCScanCompleted: Optional callback function to be called when the NFC scan is completed. Theresultparameter will contain anNFCScanResultobject with the result of the NFC scan.onFaceAuthenticationCompleted: Optional callback function to be called when the face authentication is completed. Theresultparameter will contain aFaceAuthenticationResultobject with the result of the face authentication.onSSLPinningFailed: Optional callback function to be called when the SSL pinning fails.onEvents: Optional callback function to be called when an event occurs during the onboarding flow. Theresultparameter will contain anOnEventsResultobject with the event details.onUserCancelled: Optional callback function to be called when the user cancels the onboarding flow.
Example
OnboardingSessionConfiguration sessionConfig = OnboardingSessionConfiguration();
OnboardingFlowConfiguration flowConfig = OnboardingFlowConfiguration();
flowConfig.addIdScan();
flowConfig.addSelfieScan();
flowConfig.addFaceMatch();
OnboardingRecordSessionConfiguration recordSessionConfig = OnboardingRecordSessionConfiguration(recordSession: true, forcePermission: false);
IncodeOnboardingSdk.startOnboarding(
sessionConfig: sessionConfig,
flowConfig: flowConfig,
recordSessionConfig: recordSessionConfig,
onSuccess: () {
print('Incode Onboarding completed!');
},
onError: (String error) {
print('Incode onboarding error: $error');
},
onSelfieScanCompleted: (SelfieScanResult result) {
print('Selfie completed result: $result');
},
onIdFrontCompleted: (IdScanResult result) {
print('onIdFrontCompleted result: $result');
},
onIdBackCompleted: (IdScanResult result) {
print('onIdBackCompleted result: $result');
},
onIdProcessed: (String ocrData) {
print('onIdProcessed result: $ocrData');
},
);setupOnboardingSession
Creates an onboarding session without starting any flow. Before calling any other Onboarding SDK component that operates on a session (for example startNewOnboardingSection), you must set up an onboarding session first.
Signature
Future<void> IncodeOnboardingSdk.setupOnboardingSession({
required OnboardingSessionConfiguration sessionConfig,
required Function(OnboardingSessionResult result) onSuccess,
required Function(String error) onError,
})Required Parameters
sessionConfig: AnOnboardingSessionConfigurationobject that contains the configuration for the onboarding session. It can be configured in the same way as explained forstartOnboarding.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(OnboardingSessionResult result): Delivers the details of the created session.onError(String error): Delivers the error message on failure.
Example
OnboardingSessionConfiguration sessionConfiguration = OnboardingSessionConfiguration();
IncodeOnboardingSdk.setupOnboardingSession(
sessionConfig: sessionConfiguration,
onError: (String error) {
print('Incode onboarding session error: $error');
},
onSuccess: (OnboardingSessionResult result) {
print('Incode Onboarding session created! $result');
},
);startNewOnboardingSection
Once a new onboarding session is created (see setupOnboardingSession), you can separate the Onboarding SDK flow into multiple sections based on your needs. Each section runs the modules defined in its flowConfig and is identified by a flowTag.
Signature
IncodeOnboardingSdk.startNewOnboardingSection({
required OnboardingFlowConfiguration flowConfig,
required String flowTag,
OnboardingRecordSessionConfiguration? recordSessionConfig,
required Function(String error) onError,
Function(String flowTag)? onOnboardingSectionCompleted,
// ...optional per-module step callbacks (see startOnboarding)
})Required Parameters
flowConfig: AnOnboardingFlowConfigurationobject that defines which modules run in this section.flowTag: A required identifier for the section. It is passed back inonOnboardingSectionCompleted.
Optional Parameters
recordSessionConfig: An optionalOnboardingRecordSessionConfigurationobject that contains the configuration for recording the session.
Returns / Callbacks
onOnboardingSectionCompleted(String flowTag): Optional callback function to be called when the section is completed. TheflowTagparameter contains the identifier of the completed section.onUserCancelled: Optional callback function to be called when the user cancels the onboarding flow.onError: Callback function to be called in case an error occurs during the section.- This method also accepts the same optional per-module step callbacks as
startOnboarding(for exampleonSelfieScanCompleted,onIdFrontCompleted,onIdBackCompleted,onIdProcessed,onFaceMatchCompleted,onEvents, …).
Example
OnboardingFlowConfiguration flowConfig = OnboardingFlowConfiguration();
flowConfig.addIdScan();
IncodeOnboardingSdk.startNewOnboardingSection(
flowConfig: flowConfig,
flowTag: 'idSection',
onError: (String error) {
print('Incode onboarding session error: $error');
},
onIdFrontCompleted: (IdScanResult result) {
print('onIdFrontCompleted result: $result');
},
onIdBackCompleted: (IdScanResult result) {
print('onIdBackCompleted result: $result');
},
onIdProcessed: (String ocrData) {
print('onIdProcessed result: $ocrData');
},
onOnboardingSectionCompleted: (String flowTag) {
print('section completed');
},
);finishFlow
Finishes the current onboarding session. Make sure to call finishFlow() at the end of the flow — when you are sure the user has finished all onboarding modules, and you won't be reusing the same interviewId again.
Signature
Future<void> IncodeOnboardingSdk.finishFlow({
Function()? onSuccess,
Function(String error)? onError,
})Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(): Optional callback function to be called when the flow is finished successfully.onError(String error): Optional callback function to be called in case finishing the flow fails. Theerrorparameter contains a string describing the error.
Example
IncodeOnboardingSdk.finishFlow();startFlow
Starts a server-configured flow based on the OnboardingSessionConfiguration provided, specify the configurationId, and optionally the interviewId if you want to resume a certain onboarding session, and/or moduleId to start from a specific step within the flow.
Signature
IncodeOnboardingSdk.startFlow({
required OnboardingSessionConfiguration sessionConfig,
String? moduleId,
required Function() onSuccess,
required Function(String error) onError,
Function()? onUserCancelled,
// ...optional per-module step callbacks (see startOnboarding)
})Required Parameters
sessionConfig: AnOnboardingSessionConfigurationobject. For a server-driven flow, set itsconfigurationIdand optionallyinterviewId.
Optional Parameters
moduleId: Optional identifier of the step to start from within the flow (for example"PHONE").
Returns / Callbacks
onSuccess(): Callback function to be called when the flow completes successfully.onError(String error): Callback function to be called in case an error occurs during the flow.onUserCancelled(): Optional callback function to be called when the user cancels the flow.- This method also accepts the same optional per-module step callbacks as
startOnboarding.
Example
OnboardingSessionConfiguration sessionConfig = OnboardingSessionConfiguration(
configurationId: "YOUR_CONFIGURATION_ID",
interviewId: "YOUR_INTERVIEW_ID"
); // optional
IncodeOnboardingSdk.startFlow(
sessionConfig: sessionConfig,
moduleId: 'YOUR_MODULE_ID', // optional, ie. "PHONE"
onError: (String error) {
print('Incode startFlow error: $error');
},
onSuccess: () {
print('Incode startFlow completed!');
},
onUserCancelled: () {
print('User cancelled');
},
);startFlowFromDeepLink
Starts a flow based on a deeplink URL. This method reads the configurationId, interviewId and the step from which it should start directly from the URL.
Signature
IncodeOnboardingSdk.startFlowFromDeepLink({
required String url,
required Function() onSuccess,
required Function(String error) onError,
Function()? onUserCancelled,
// ...optional per-module step callbacks (see startOnboarding)
})Required Parameters
url: The deeplink URL that encodes theconfigurationId,interviewIdand starting step.
Returns / Callbacks
onSuccess(): Callback function to be called when the flow completes successfully.onError(String error): Callback function to be called in case an error occurs during the flow.onUserCancelled(): Optional callback function to be called when the user cancels the flow.- This method also accepts the same optional per-module step callbacks as
startOnboarding.
Example
IncodeOnboardingSdk.startFlowFromDeepLink(
url: 'YOUR_DEEPLINK_URL',
onError: (String error) {
print('Incode startFlowFromDeepLink error: $error');
},
onSuccess: () {
print('Incode startFlowFromDeepLink completed!');
},
onUserCancelled: () {
print('User cancelled');
},
);startWorkflow
Starts a server-defined workflow for the provided OnboardingSessionConfiguration. The set of modules that run is determined by the workflow configured on the Incode dashboard, rather than by a locally-defined flowConfig.
Signature
IncodeOnboardingSdk.startWorkflow({
required OnboardingSessionConfiguration sessionConfig,
required Function() onSuccess,
required Function(String error) onError,
Function()? onUserCancelled,
// ...optional per-module step callbacks (see startOnboarding)
})Required Parameters
sessionConfig: AnOnboardingSessionConfigurationobject. Set itsconfigurationIdto point at the workflow configured on the dashboard.
Returns / Callbacks
onSuccess(): Callback function to be called when the workflow completes successfully.onError(String error): Callback function to be called in case an error occurs during the workflow.onUserCancelled(): Optional callback function to be called when the user cancels the workflow.- This method also accepts the same optional per-module step callbacks as
startOnboarding.
Example
OnboardingSessionConfiguration sessionConfig = OnboardingSessionConfiguration(
configurationId: "YOUR_CONFIGURATION_ID"
);
IncodeOnboardingSdk.startWorkflow(
sessionConfig: sessionConfig,
onError: (String error) {
print('Incode startWorkflow error: $error');
},
onSuccess: () {
print('Incode startWorkflow completed!');
},
onUserCancelled: () {
print('User cancelled');
},
);faceMatch
Programmatically initiates a face match between the photo from the ID and the selfie. It does the matching silently in the background, compared to the regular Face Match module that shows UI feedback to the user. This API can only be used during a session.
Signature
Future<void> IncodeOnboardingSdk.faceMatch({
FaceMatchType? faceMatchType,
String? interviewId,
IdCategory? idCategory,
required Function() onSuccess,
required Function(String error) onError,
Function(FaceMatchResult faceMatchResult)? onFaceMatchCompleted,
Function()? onUserCancelled,
})Optional Parameters
faceMatchType: OptionalFaceMatchTypeselecting which sources are compared —idSelfie,nfcSelfieornfc3Way.interviewId: Optional identifier of the session to run the match against.idCategory: OptionalIdCategory(primaryorsecondary) selecting which scanned ID to use.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(): Callback function to be called when the face match completes successfully.onError(String error): Callback function to be called in case the operation fails.onFaceMatchCompleted(FaceMatchResult result): Optional callback function that delivers theFaceMatchResult.onUserCancelled(): Optional callback function to be called when the user cancels.
Example
IncodeOnboardingSdk.faceMatch(
onError: (String error) {
print('FaceMatch error: $error');
},
onSuccess: () {
print('FaceMatch completed!');
},
onUserCancelled: () {
print('FaceMatch cancelled by user.');
},
onFaceMatchCompleted: (FaceMatchResult result) {
print('✅ FaceMatch result: $result');
}
);setTheme
Applies a custom theme to the SDK UI.
Signature
Future<void> IncodeOnboardingSdk.setTheme({
required Map<String, dynamic> theme,
})Required Parameters
theme: A map describing the theme. It is JSON-encoded internally before being passed to the native SDK.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves.
Example
await IncodeOnboardingSdk.setTheme(theme: {
'primaryColor': '#0000FF',
});setSdkMode
Sets the SDK operating mode, controlling whether the SDK captures data, submits it, or both.
Signature
Future<void> IncodeOnboardingSdk.setSdkMode({
required SdkMode sdkMode,
})Required Parameters
sdkMode: TheSdkModeto use —captureOnly,submitOnlyorstandard.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves.
Example
await IncodeOnboardingSdk.setSdkMode(sdkMode: SdkMode.standard);showCloseButton
Displays an 'X' button on the top right of each module so that the user can cancel the flow at any point.
Signature
Future<void> IncodeOnboardingSdk.showCloseButton({
required bool allowUserToCancel,
})Required Parameters
allowUserToCancel: Iftrue, the close button is shown and the user can cancel the flow.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves.
Example
IncodeOnboardingSdk.showCloseButton(allowUserToCancel: true);setLocalizationLanguage
Overrides the language used for the SDK UI strings.
Signature
Future<void> IncodeOnboardingSdk.setLocalizationLanguage({
required String language,
})Required Parameters
language: The language code to use (for example"en"or"es").
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves.
Example
await IncodeOnboardingSdk.setLocalizationLanguage(language: 'es');setString
Overrides individual UI strings by key, allowing custom copy without changing the localization language.
Signature
Future<void> IncodeOnboardingSdk.setString({
required Map<String, dynamic> strings,
})Required Parameters
strings: A map of string keys to their override values.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves.
Example
await IncodeOnboardingSdk.setString(strings: {
'selfie_scan_title': 'Take a selfie',
});getUserScore
Fetches the current onboarding session user score at any point.
Signature
Future<void> IncodeOnboardingSdk.getUserScore({
UserScoreFetchMode? fetchMode,
required Function(UserScoreResult result) onSuccess,
required Function(String error) onError,
})Optional Parameters
fetchMode: OptionalUserScoreFetchMode(fastoraccurate) controlling the trade-off between speed and accuracy.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(UserScoreResult result): Callback function to be called with the score. Theresultparameter contains aUserScoreResultobject.onError(String error): Callback function to be called in case the operation fails.
Example
IncodeOnboardingSdk.getUserScore(
onSuccess: (UserScoreResult result) {
print("userScore: $result");
},
onError: (String error) {
print("userScore error: $error");
});idProcess
Processes IDs programmatically without displaying a user interface (Non-UI ID processing).
Signature
Future<void> IncodeOnboardingSdk.idProcess({
IdCategory? idCategory,
required Function(IdProcessResult result) onSuccess,
required Function(String error) onError,
})Optional Parameters
idCategory: OptionalIdCategory(primaryorsecondary) selecting which ID to process.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(IdProcessResult result): Callback function to be called when processing completes. Theresultparameter contains anIdProcessResultobject.onError(String error): Callback function to be called in case the operation fails.
Example
IncodeOnboardingSdk.idProcess(
idCategory: IdCategory.primary,
onSuccess: (IdProcessResult result) {
print(result);
},
onError: (String error) {
print(error);
},
);startFaceLogin
Authenticates a returning user by their face. A prerequisite for a successful Face Login is that the user has an approved account with an enrolled face. Pass a customerUUID on the FaceLogin object to perform a 1:1 comparison, or omit it to perform a 1:N database lookup.
Signature
Future<void> IncodeOnboardingSdk.startFaceLogin({
required FaceLogin faceLogin,
required Function(FaceLoginResult result) onSuccess,
required Function(String error) onError,
})Required Parameters
faceLogin: AFaceLoginobject describing how the login should run. Key fields:customerUUID: Set for a 1:1 login; omit for a 1:N database lookup. If the user was approved during onboarding on a mobile device, you should have received thecustomerUUIDfrom the Approve step.faceAuthMode:FaceAuthMode.server(default) orFaceAuthMode.localfor an on-device, offline-capable check. See Face Login parametrization.faceAuthModeFallback,lensesCheck,faceMaskCheck,logAuthenticationEnabled,recognitionThreshold,spoofThreshold,e2eeEncryptionEnabled: optional tuning flags described under Face Login parametrization.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(FaceLoginResult result): Callback function to be called when the login completes. Theresultparameter contains aFaceLoginResultobject which consists of:image: selfie imagespoofAttempt: boolean that indicates if the user tried to spoof the systembase64Images: base64 representations of the selfie imagefaceMatched: boolean that indicates if the faces matchedcustomerUUID: unique user identifier if the user successfully authenticatedinterviewId: sessionId in which the user got approvedinterviewToken: session token in which the user got approvedtoken: token that can be used for further API callstransactionId: unique identifier of the face login attempthasLenses: indicator if the login attempt failed due to the person wearing lenses (1:1 mode)hasFaceMask: indicator if the login attempt failed due to the person wearing a face mask (1:1 mode)
onError(String error): Callback function to be called in case the login fails. Theerrorparameter contains a string describing the error.
Example
// 1:1 Face Login — performs a 1:1 face comparison.
IncodeOnboardingSdk.startFaceLogin(
faceLogin: FaceLogin(customerUUID: "yourCustomerUUID"),
onSuccess: (FaceLoginResult result) {
print(result);
},
onError: (String error) {
print(error);
},
);
// 1:N Face Login — performs a 1:N database face lookup.
IncodeOnboardingSdk.startFaceLogin(
faceLogin: FaceLogin(),
onSuccess: (FaceLoginResult result) {
print(result);
},
onError: (String error) {
print(error);
},
);Face Login parametrization
Authorization modes
By default, Face Login will perform server spoof and face recognition check.
To perform both spoof and face recognition checks locally on device provide FaceAuthMode.local as faceAuthMode to FaceLogin object. This makes it possible to authenticate users while being offline. Prerequisite for a successful offline face login is that the user was onboarded and approved on the same device.
To use FaceAuthMode.local mode on Android, please add the 'com.incode.sdk:model-liveness-detection:[VERSION]' and 'com.incode.sdk:model-face-recognition:[VERSION]' dependencies to your app/build.gradle file.
To perform a one-time server authentication in case a user isn't found locally on the device during FaceAuthMode.local execution, specify faceAuthModeFallback to true. It works only in 1:1 Face Login mode.
To adjust spoof and recognition thresholds for the FaceAuthMode.local mode, specify spoofThreshold and recognitionThreshold params to FaceLogin object.
Face mask check
By default, Face Login won't detect if people wear face masks.
To enable face mask check specify faceMaskCheck parameter to true in FaceLogin.
Lenses check
By default, Face Login will detect if people wear lenses.
To disable lenses check specify lensesCheck parameter to false in FaceLogin.
Log Authentication attempts
By default, each authentication attempt is logged, and some statistics info like device used is being tracked.
Specify logAuthenticationEnabled false if you want to disable this to get faster performing authentications.
End-to-End Encryption (E2EE)
By default, End-to-End Encryption is disabled for Face Login.
To enable E2EE, specify e2eeEncryptionEnabled parameter to true in FaceLogin. This is currently supported on Android only.
Manipulating locally stored identities
To manipulate locally stored identities you must use Flutter SDK -l variant.
To authenticate multiple users using 1:N and FaceAuthMode.local mode you'll need to add these identities to the local database. This section will describe which methods you can use to perform CRUD operations with locally stored identities.
addNOM151Archive
Generates and fetches a NOM151 archive for the current session.
Signature
Future<void> IncodeOnboardingSdk.addNOM151Archive({
required Function(AddNom151Result result) onSuccess,
required Function(String error) onError,
})Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(AddNom151Result result): Callback function to be called when the archive is generated. Theresultparameter contains anAddNom151Resultobject, which contains two String fields:signatureandarchiveUrl.onError(String error): Callback function to be called in case the operation fails.
Example
IncodeOnboardingSdk.addNOM151Archive(
onSuccess: (AddNom151Result addNom151Result) {
String? signature = addNom151Result.signature;
String? archiveUrl = addNom151Result.archiveUrl;
},
onError: (String error) {
print('Incode addNOM151Archive error: $error');
},
);addFace
Adds a single identity to the local database.
Signature
Future<void> IncodeOnboardingSdk.addFace({
required FaceInfo faceInfo,
required Function(bool result) onSuccess,
required Function(String error) onError,
})Required Parameters
faceInfo: AFaceInfoobject describing the identity, which contains:faceTemplate: String — biometric representation of a user's facecustomerUUID: String — unique customer identifier in Incode's databasetemplateId: String — unique identifier of a biometric representation of a user's face in Incode's database
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(bool result): Callback function to be called when the identity is added. Theresultparameter istrueon success.onError(String error): Callback function to be called in case the operation fails.
Example
FaceInfo faceInfo = FaceInfo(template, uuid, templateId);
IncodeOnboardingSdk.addFace(
faceInfo: faceInfo,
onSuccess: (bool result) {
print(result);
},
onError: (String error) {
print(error);
},
);removeFace
Removes a single identity from the local database.
Signature
Future<void> IncodeOnboardingSdk.removeFace({
required String customerUUID,
required Function(bool result) onSuccess,
required Function(String error) onError,
})Required Parameters
customerUUID: The unique customer identifier of the identity to remove.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(bool result): Callback function to be called when the identity is removed. Theresultparameter istrueon success.onError(String error): Callback function to be called in case the operation fails.
Example
IncodeOnboardingSdk.removeFace(
customerUUID: "your_customer_uuid",
onSuccess: (bool result) {
print(result);
},
onError: (String error) {
print(error);
},
);getFaces
Fetches all currently stored identities from the local database.
Signature
Future<void> IncodeOnboardingSdk.getFaces({
required Function(List<FaceInfo> result) onSuccess,
required Function(String error) onError,
})Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(List<FaceInfo> result): Callback function to be called with the list of stored identities. Theresultparameter contains aList<FaceInfo>.onError(String error): Callback function to be called in case the operation fails.
Example
IncodeOnboardingSdk.getFaces(
onSuccess: (List<FaceInfo> faceInfos) => {
print("faceInfos: $faceInfos")},
onError: (String error) {
print(error);
},
);setFaces
Replaces the local database with the provided list of identities. Keep in mind it will first wipe out all currently stored identities, so passing an empty list clears the database.
Signature
Future<void> IncodeOnboardingSdk.setFaces({
required List<FaceInfo> faces,
required Function(bool result) onSuccess,
required Function(String error) onError,
})Required Parameters
faces: The list ofFaceInfoobjects to store. Pass an empty list (List.empty()) to clear the database.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(bool result): Callback function to be called when the identities are stored. Theresultparameter istrueon success.onError(String error): Callback function to be called in case the operation fails.
Example
// Add multiple identities (replaces existing ones).
final faceInfos = <FaceInfo>[
FaceInfo("your_face_template", "your_customer_uuid", "your_template"),
FaceInfo("your_face_template2", "your_customer_uuid2", "your_template2")
];
IncodeOnboardingSdk.setFaces(
faces: faceInfos,
onSuccess: (bool result) => {
print("result: $result")
},
onError: (String error) {
print(error);
},
);
// Clear the local database by passing an empty list.
IncodeOnboardingSdk.setFaces(
faces: List.empty(),
onSuccess: (bool result) => {
print("result: $result")
},
onError: (String error) {
print(error);
},
);getUserOCRData
Fetches the user OCR data for a specific session.
Signature
Future<void> IncodeOnboardingSdk.getUserOCRData({
String? token,
required Function(GetUserOCRDataResult result) onSuccess,
required Function(String error) onError,
})Optional Parameters
token: Optional session token identifying the session to fetch OCR data for.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(GetUserOCRDataResult result): Callback function to be called with the OCR data. Theresultparameter contains aGetUserOCRDataResultobject, whoseocrDataString field contains the full OCR data in JSON format.onError(String error): Callback function to be called in case the operation fails.
Example
IncodeOnboardingSdk.getUserOCRData(
token: "{SESSION_TOKEN}",
onSuccess: (GetUserOCRDataResult result) {
print(result);
},
onError: (String error) {
print(error);
},
);setFaceAuthenticationHint
Provides an identity hint to speed up face authentication by indicating which identity is expected.
Signature
Future<void> IncodeOnboardingSdk.setFaceAuthenticationHint({
required String identityId,
})Required Parameters
identityId: The identifier of the identity to hint at.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves.
Example
await IncodeOnboardingSdk.setFaceAuthenticationHint(identityId: 'your_identity_id');setUXConfig
Applies a custom UX configuration to the SDK.
Signature
Future<void> IncodeOnboardingSdk.setUXConfig({
required Map<String, dynamic> jsonConfig,
})Required Parameters
jsonConfig: A map describing the UX configuration. It is JSON-encoded internally before being passed to the native SDK.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves.
Example
await IncodeOnboardingSdk.setUXConfig(jsonConfig: {
'showProgressBar': true,
});deleteLocalUserData
Deletes all locally stored user data on the device.
Signature
Future<void> IncodeOnboardingSdk.deleteLocalUserData()Returns / Callbacks
- Returns a
Future<void>that completes once the data has been deleted.
Example
await IncodeOnboardingSdk.deleteLocalUserData();FlowListeners
Tracking events
- When onboarding has been started, information about events used to track all the user steps in their flow can be obtained using
onEventscallback.
Specify onEvents to the startOnboarding method, to receive OnEventsResult:
event: String - Unique identifier of the eventdata: String? - JSON string with additional event details
Step result listeners
To listen for the results of the steps in the flow as soon as they're completed, add the optional per-module callback methods (e.g. onSelfieScanCompleted, onIdFrontCompleted, onIdBackCompleted, onIdProcessed, onFaceMatchCompleted, etc.) to the startOnboarding / startNewOnboardingSection methods. For the full list of listeners and the result objects they deliver, see the Results section.
