Operations across SDKs
| Operation | Swift | C# | Kotlin / Java | C | TypeScript |
|---|---|---|---|---|---|
| Create | MBKYC.create(...) | MBKYC.Create(...) | MBKYC.create(...) | mbkyc_create(...) | new MBKYCClient() + init(...) |
| Destroy | deinit | Dispose | close() (AutoCloseable) | mbkyc_destroy | deInit() |
| List smart card readers | listSmartcardReaders | ListSmartcardReadersAsync | listSmartcardReaders | mbkyc_list_smartcard_readers | listSmartcardReaders |
| List fingerprint readers | listFingerprintReaders | ListFingerprintReadersAsync | listFingerprintReaders | mbkyc_list_fingerprint_readers | listFingerprintReaders |
| Register device | registerDevice(name:) | RegisterDeviceAsync | registerDevice | mbkyc_register_device | registerDevice |
| Check registration | checkRegistration | CheckRegistrationAsync | checkRegistration | mbkyc_check_registration | checkRegistration |
| Validate | validate(_:) | ValidateAsync | validate | mbkyc_validate | validate |
| Export logs | exportLogs(to:) | ExportLogsAsync | exportLogs | mbkyc_export_logs | exportLogs |
| Cancel in-flight op | Task cancel | CancellationToken | coroutine cancel | CancellationTokenHandle + mbkyc_cancel_* | cancel() |
| Host info (web only) | — | — | — | — | getInfo() |
What each operation does
| Operation | Returns | Notes |
|---|---|---|
| Create | handle | Validates config and initializes the SDK. On the web, getInfo() is the only call usable before init(). |
| List readers | ReaderInfo[] | Enumerates connected smart card readers / fingerprint sensors. |
| Register device | void | Call once per device before validating. See Devices. |
| Check registration | RegistrationStatus | active / inactive / not_found. |
| Validate | VerificationResult | Takes one validation request; the shape selects the method. |
| Export logs | void | Bundles SDK + connected-service logs into a single tar.zst archive for support. |
| Destroy | void | Releases resources. Always call it (or use the language’s scoped form). |
Async model
| Platform | Model |
|---|---|
| Swift | async/await + callback overloads |
| C# | Task (async/await), honours CancellationToken |
| Kotlin | suspend functions + coroutines |
| Java | CompletableFuture |
| C | callback-based (on_success / on_error / on_cancelled) |
| TypeScript | Promises |
Results & errors
- Kotlin / Java return an
MBKYCResult<T>(Ok/Err);getOrThrow()converts to exceptions. - Swift throws
MBKYCError; C# throwsMBKYCException; the web SDK rejects withMBKYCError. - C returns/owns an
MBKYC_Error*the caller must free.
Cancellation
Every long-running operation can be cancelled:- Swift / Kotlin — cancel the surrounding
Task/ coroutine. - C# — pass a
CancellationToken; cancelling resolves the task withTaskCanceledException. - C — create an
MBKYC_CancellationTokenHandle, pass it to the call, andmbkyc_cancel_token_cancel(token). - Web — call
client.cancel().

