zkKYC - Know Your Customer
This page covers the compliance-related features of zkKYC. If you want to integrate MeID, please jump to Proof-of-Personhood (MeID)for the MeID-specific guide.
Use Case
To reduce the development cost for the project side, the project can use zkKYC capability by simply accessing the link. Users can complete full KYC verification directly on the web/H5, reducing user churn by minimizing the need to navigate to another page.
zkMe-Widget KYC Process
Step 1: Enter the service authorization Widget page; the user confirms and goes to the next step
Step 2: E-mail verification login
Step 3: Verify the SBT to confirm that it is authenticated
Step 4: Depending on the KYC configuration of the project, determine whether the user needs to undergo different verification processes.
Interaction Instructions

Integration via NPM
You can refer to @zkmelabs/widget and please make sure to use the latest version.
Installation
Getting Started
Step 1. Import styles
Step 2. Create a new ZkMeWidget instance
ZkMeWidget instanceNOTE: The specific configuration for the "option" parameter is shown in the table below
options.lv
VerificationLevel?
"zkKYC" or "MeID", default "zkKYC"
options.programNo
string?
If you have activated multiple programs running in parallel, please pay attention to this setting:
The param can be found in Dashboard and please make sure the program is enabled. The SDK will take the number of the first activated program as the default value if this parameter is not provided in the code.
options.theme
Theme?
"auto", "light" or "dark", default "auto".
options.locale
Language?
"en" or "zh-hk", default "en".
Step 3. Listen to the kycFinished widget events to detect when the user has completed the zkKYC process.
kycFinished widget events to detect when the user has completed the zkKYC process.Step 4. Launch the zkMe widget and it will be displayed in the center of your webpage.
Helper functions
verifyKycWithZkMeServices()
Before launching the widget, you should check the zkKYC status of the user and launch the widget when the check result is false.
appId
string
This parameter means the same thing as "mchNo"
userAccount
string
The userAccount info (such as wallet address, email, phone number, or unique identifier) must match the format of accounts returned by provider.getUserAccounts.
options.programNo
string?
If you have activated multiple programs running in parallel, please pay attention to this setting: The param can be found in Dashboard and please make sure the program is enabled. The SDK will take the number of the first activated program as the default value if this parameter is not provided in the code.
If the level of your Dashboard account is not Cross-Chain, then you can also query users' zkKYC status from zkMe Verify & Certify Smart Contract here.
How to Generate an Access Token with API_KEY
To use your API_KEY to obtain an accessToken, you will need to make a specific HTTP request. Here's how you can do it:
a. Endpoint: Send a POST request to the token exchange endpoint.
POST request to the token exchange endpoint.Please remember to modify the Content-Type in the request header to application/json. Failing to do so might result in a Parameter Error response.
b. Request Body:
apiKey
True
string
The API_KEY provided by zkMe.
appId
True
string
A unique identifier (mchNo) to DApp provided by zkMe.
apiModePermission
True
number
0 - email login (Only support email login)
lv
True
number
1 - zkKYC 2 - MeID
API_KEYcan be found in the Configuration section of the Integration on the zkMe Dashboard.
c. Response
ZkMeWidget instance methods
switchChain()
If your DApp integrates multiple chains, use this method to synchronize the new chain to the zkMe widget when the user switches chains in your DApp.
destroy()
Remove the message event listener registered by the zkMe widget from the window and destroy the DOM node.
Common Response & Exceptions
Success
If the user has passed the KYC verification and the user’s SBT could be accessed by your project, the following interface will be seen. Meanwhile, there will be a message with KYC results sent to your DApp.

Camera Permission Denied Error
The following screen will be displayed for possible issues such as the user denying browser camera access or not having a camera on the device.

OCR Scan Error
The following screen will be displayed when an exception occurs during the OCR process.

Face Recognition Error
The following screen will be displayed for possible problems such as eyes closed detected, art mask detected etc.

Face Mismatch Error
The following screen will be displayed when the face could not match the uploaded ID.

Faceprint Mismatch Error
The following screen will be displayed for the possible problem that the fully homomorphically encrypted faceprint does not match the one associated with this MeID.

Last updated

