## init

Initializes the native Incode SDK. Must be called at least once per app lifecycle before any other operation.

**Signature**

Dart

```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 to `true`, the SDK will log debug information to the console. Default is `true`.
- `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 to `true`.
- `waitForTutorials`: If set to `true`, the SDK will wait for the user to complete the tutorials before starting the onboarding flow. Default is `false`.
- `disableJailbreakDetection`: If set to `true`, the SDK will not check for jailbreak/rooted devices. Default is `false`.
- `externalAnalyticsEnabled`: If set to `true`, the SDK will send analytics events to the external analytics provider. Default is `false`.
- `externalScreenshotsEnabled`: If set to `true`, the SDK will allow screenshots to be taken. Default is `false`.
- `clientExperimentId`: If set, the SDK will send this value to the server to be used for A/B testing. Default is `null`.
- `sslPinningEnabled`: If set to `true`, the SDK will enable SSL pinning. Default is `false`.
- `forceSSLPinning`: If set to `true`, the SDK will force SSL pinning even if the server does not support it. Default is `false`.

**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

```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

```dart
Future<bool> IncodeOnboardingSdk.isInitialized()
```

**Returns / Callbacks**

- Returns a `Future<bool>` that resolves to `true` when the SDK is ready to be used, and `false` otherwise.

**Example**

Dart

```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

```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`: An `OnboardingSessionConfiguration` object that contains the configuration for the onboarding session.
- `flowConfig`: An `OnboardingFlowConfiguration` object that contains the configuration for the onboarding flow.

**Optional Parameters**

- `recordSessionConfig`: An optional `OnboardingRecordSessionConfiguration` object that contains the configuration for recording the onboarding session.

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