Working with clientKey
clientKey is a user-defined identifier that you assign yourself and use to link KYC sessions with your users, applications, or contracts.
With clientKey you can:
find all KYC sessions for a specific user;
associate verification results with your objects (userId, orderId, loanId, etc.);
filter sessions through the REST API;
more easily process webhooks.
Important: the value of clientKey is defined by you — the platform does not generate it automatically.
Format and limitations
Type:
stringMaximum length: 36 characters
Format: any string, recommended to use Latin letters, digits, separators (
[a-zA-Z0-9_-])
Recommended usage:
clientKey = userId— if one KYC check per user;clientKey = "${userId}:${applicationId}"— if KYC is linked to an application, order, contract;clientKey = UUID— if it is more convenient to work only with a KYC identifier.
Two forms of clientKey: raw and encrypted
clientKey: raw and encryptedFor WebSDK integration, it is important to understand that there are:
Raw value (
clientKeyRaw) The value you define: e.g.,"user_123"or"loan-42".Encrypted value (
clientKey) The value you actually pass to the widget. It is the result of encryptingclientKeyRawusing the scenario's secret key from the dashboard.
Workflow structure:
On your backend:
generate
clientKeyRaw(up to 36 characters);encrypt it with the scenario secret key;
send the encrypted
clientKeyto the frontend.
On the frontend:
pass the encrypted
clientKeyintoKYCWidget.setupKYC(...).
On the KYC service side:
the value is decrypted;
raw
clientKeyRawis stored in the session;you can filter sessions and get results by it via API and webhooks.
In the API (
/kyc/session/status,/kyc/sessions/filterand webhooks) you work with the raw value you defined. Encryption is needed only for secure transfer ofclientKeyto the browser.
Where clientKey is used
clientKey is usedIn WebSDK
Widget call:
In REST API
/kyc/session/status— you can passclientKeyto check the status for the specific key;/kyc/sessions/filter— there is aclientKeyfilter to get all sessions by this key.
Here you pass the raw value (clientKeyRaw), without encryption.
Generating and encrypting clientKey on backend
clientKey on backendThe scenario secret key is stored only on your server. It must never be sent to the browser.
General idea:
Take
clientKeyRaw(up to 36 characters).Take scenario secret key (
scenarioSecretKey) from the dashboard.Encrypt
clientKeyRawon backend (example — AES-256-CBC).Encode the result in Base64 and pass it to WebSDK as
clientKey.
Node.js example (AES-256-CBC)
Use this encrypted clientKey in:
The “Check” button next to the scenario secret key in the dashboard uses the same algorithm and helps verify that encryption/decryption works correctly. For production always encrypt on your server.
How to test clientKey
clientKeyIn the dashboard, find the scenario secret key.
Click “Check” and enter a test
clientKeyRaw(e.g.,test_user_1).The dashboard will return the encrypted value — you can temporarily use it in integration examples.
Ensure that:
the widget opens without errors;
in your KYC sessions logs, the raw
clientKeyRawis visible (e.g., through filtering via/kyc/sessions/filter).
Common questions and issues
“Where do I get clientKey and clientUser values?”
clientKey and clientUser values?”clientKey— any string up to 36 chars that you define:userId, application number, order ID, any useful value. This parameter is required.clientUser— also any string up to 36 chars, but in new integrations you should avoid using it.
Best practice: set
clientKeyRawequal to youruserIdororderId, encrypt it and pass onlyclientKey.
Error: “Failed to perform asymmetric decryption!”
This usually means:
a raw
clientKeyRawwas passed to the widget instead of an encrypted value;or a wrong scenario secret key was used;
or
clientKeywas corrupted or truncated (e.g., copy/paste issue).
Check that:
You pass a proper Base64 encrypted value to the widget.
The scenario in the dashboard matches the secret key used for encryption.
You are not using the deprecated
clientUserparameter.
“How to decipher clientKey for a webhook?”
clientKey for a webhook?”You do not need clientKey to decrypt webhook data:
webhook payload is encrypted with the webhook secret, not the
clientKey;to decrypt you only need your webhook secret and the encrypted field from the POST.
clientKey inside the webhook JSON is simply the raw value you defined (clientKeyRaw).
“Why is the webhook field encrypted always different even for the same JSON?”
encrypted always different even for the same JSON?”This is expected:
encryption uses random IV (initialization vector);
same JSON + same key = different ciphertext every time;
after decryption the JSON is identical.
“How is the general success/failed status determined?”
success/failed status determined?”Overall KYC session status:
success— only if all checks pass;if any check fails (OCR, fraud, databases, etc.) → overall status is
failed.
External database checks (sanctions, Court Enforcement Office, etc.) also affect the overall status. Any critical red flag results in failed.
Recommended workflow with clientKey
clientKeyOn backend at the beginning of KYC process:
generate or choose
clientKeyRaw(e.g.,user_123);encrypt it →
encryptedClientKey;save
clientKeyRawon your side together with userId/orderId.
On frontend:
pass
encryptedClientKeytoKYCWidget.setupKYC(...).
To obtain results:
receive webhook and inspect
clientKeyinside decrypted JSON;or call
/kyc/sessions/filterwithclientKey = clientKeyRaw.
This ensures you always know which user or application each KYC session belongs to.
Last updated