Download the example
A self-contained CLI (with a vendored
cJSON). Populate deps/ (see below), fill in the config block, and make.Populating the example's deps/ folder
Populating the example's deps/ folder
The example builds against the header + shared library in Folders by platform:
deps/include/ and deps/lib/. The C SDK is published as individual per-platform files in the Nexus raw repository under mbkyc/mbkyc-capi/<version>/<platform>/ — download the two for your platform (no archive to extract). macOS arm64 example:macos-arm64 / macos-x64 (libmbkyc_capi.dylib), linux (libmbkyc_capi.so), windows (mbkyc_capi.dll + .lib). On Linux you can instead install the .deb/.rpm below and copy from /usr/include/mbkyc/ and /usr/lib/.Install
- Linux
- Windows
- macOS
.deb (apt) or .rpm (yum) — installs headers to /usr/include/mbkyc/ and libs to /usr/lib/. See Configure Nexus.include/mbkyc_capi.h (+ mbkyc_errors.h) and lib/libmbkyc_capi.{so,dylib,dll}.
Create a handle
The config carries the base URL, the non-secretapi_key_id, and a token-signing callback. The SDK invokes sign_cb with the JWT signing input (header.payload bytes); you HMAC-SHA256 it via the holder of the API secret and hand the raw signature back through response_cb.
sign_cb and sign_user_data must remain valid until mbkyc_destroy. On failure, set result.kind = MBKYC_SIGN_RESULT_KIND_SIGN_ERROR before calling response_cb.
Validate — tagged union
mbkyc_validate takes one MBKYC_ValidationRequest. The request_type discriminator selects which payload field is valid:
To read a card or capture a fingerprint, install the matching desktop service first (PC/SC for card readers, your fingerprint vendor’s service for biometrics). Without them, reader enumeration returns empty. Manual entry needs no services.
- Emirates ID
- Passport
- Manual entry —
MBKYC_VALIDATION_REQUEST_TYPE_EMIRATES_ID_MANUAL. No hardware. - Card read —
MBKYC_VALIDATION_REQUEST_TYPE_EMIRATES_ID_CARD. Needs a smart card reader + PC/SC service. - + Fingerprint —
MBKYC_VALIDATION_REQUEST_TYPE_EMIRATES_ID_MANUAL_BIOMETRICandMBKYC_VALIDATION_REQUEST_TYPE_EMIRATES_ID_CARD_BIOMETRIC. Needs a fingerprint sensor + its service (in addition to the card reader for the card variant).
request_type selects the matching payload field, per the discriminator reference:
request_type | Payload field | Biometric |
|---|---|---|
..._EMIRATES_ID_CARD | emirates_id_card | no |
..._EMIRATES_ID_CARD_BIOMETRIC | emirates_id_card_biometric | yes |
..._EMIRATES_ID_MANUAL | emirates_id_manual | no |
..._EMIRATES_ID_MANUAL_BIOMETRIC | emirates_id_manual_biometric | yes |
..._PASSPORT_MANUAL | passport_manual | no |
Callback contract
Every async call takes three callbacks + auser_data pointer:
- Exactly one of success / error / cancelled fires per invocation.
- The success
resultis owned by the library until you callmbkyc_verification_result_free. - The
errormust be freed viambkyc_error_free; strings viambkyc_string_free. - Callbacks run on an internal worker thread — marshal to your event loop if needed.
Cancellation & errors
mbkyc_errors.h; see the error reference.
A reference CLI lives at
integrations/c/src/main.c in the SDK repo — readers, register, check-registration, validate (with optional --fp-reader), export-logs. It’s the fastest way to see a working signer and biometric callback.Function reference
Shared value types are described in Data types; the full list ofMBKYC_* types is in mbkyc_capi.h and error codes in mbkyc_errors.h.
| Function | Purpose |
|---|---|
mbkyc_create(const MBKYC_Config*, MBKYC_Handle** out) → MBKYC_Error* | Create a handle. |
mbkyc_destroy(MBKYC_Handle*) | Destroy a handle. |
mbkyc_list_smartcard_readers(handle, user_data, on_readers, on_error) | Enumerate smart card readers. |
mbkyc_list_fingerprint_readers(handle, user_data, on_readers, on_error) | Enumerate fingerprint sensors. |
mbkyc_register_device(handle, name, user_data, on_success, on_error) | Register the device. |
mbkyc_check_registration(handle, user_data, on_status, on_error) | Query registration status. |
mbkyc_validate(handle, request, cancel_token, user_data, on_success, on_error, on_cancelled) | Run a validation. |
mbkyc_export_logs(handle, path, user_data, on_success, on_error) | Bundle logs to a tar.zst. |
mbkyc_cancel_token_create() / _cancel(token) / _free(token) | Cancellation. |
mbkyc_error_code(err) / mbkyc_error_message(err) | Read an error. |
mbkyc_error_free(err) / mbkyc_string_free(s) / mbkyc_verification_result_free(r) | Free owned memory. |

