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

Returns / Callbacks

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

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

Optional Parameters

... (continues with the rest of the content)