API Reference
init
Initializes the native Incode SDK. Must be called at least once per app lifecycle before any other operation.
Signature
Dart
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
Dart
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
Dart
Future<bool> IncodeOnboardingSdk.isInitialized()
Returns / Callbacks
- Returns a
Future<bool>that resolves totruewhen the SDK is ready to be used, andfalseotherwise.
Example
Dart
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
Dart
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.
... (continues with the rest of the content)