pipwave-ekyc-sdk v1.2.0
Project Name
Pipwave eKYC SDK for Javascript
Description
Welcome to the Pipwave eKYC SDK for JavaScript! This readme serves as your comprehensive guide to seamlessly integrate eKYC into your client app. Explore the Pipwave eKYC SDK's structure, delve into its extra features, and smoothly follow the installation process.
Implementing eKYC in your client app is simpler than ever. Just upload identity documents, submit a selfie, and effortlessly retrieve or update verification results.
Installation
Begin your journey with the Pipwave eKYC SDK using either the Npm or Yarn package manager.
Npm To install the Pipwave eKYC SDK via npm, ensure Node.js is on your system, and execute this command:
$ npm install pipwave-ekyc-sdk
Yarn To install the SDK with Yarn, execute this command:
$ yarn add pipwave-ekyc-sdk
Alternatively, if you prefer not to use a package manager, you can manually download the latest Pipwave eKYC SDK for JavaScript from the provided repository link:
For manual download, include the SDK in your project using this script tag:
<script src="/your-own-path-to-sdk/PwEkyc.min.js"></script>
Usage
Kickstart your eKYC journey with the Pipwave eKYC SDK by initializing it at the outset of your project. All that's required is your Access Token to get started. Here's how:
import { PWSDK } from "pw-ekyc-web-sdk";
const pwInstance = new PWSDK();
await pwInstance.init(YOUR_ACCESS_TOKEN)
SDK Documentation
Once the Pipwave eKYC SDK is initialized, you can unlock its full potential by making use of its properties and functionalities. The SDK supports two vital verification types: Identity Document and Selfie.
Properties
1. Verification Types
Retrieve the verification types which a user requires to perform eKYC on, by using the following code:
const types = pwInstance.verificationTypes
Output
The result is an array of string with the following possible values:
- national_identity_document
- selfie
2. Default Issuing Country
Retrieve the default country using the following code:
const country = pwInstance.defaultCountry
Output
The result is a Country object with the following properties: | Property | Description | |--|--| | isocode | Country code in ISO2 format (Example: my, id) | | name | Full name of Country (Example: Malaysia, Indonesia)_ |
3. Issuing Country List
Retrieve all issuing countries in ISO2 format:
const issuingCountries = pwInstance.issuingCountries
Output
The result is an array of Country objects. Refer to the Country for more details.
4. Full Country List
Retrieve all countries in ISO2 format:
const countries = pwInstance.countries
Output
The result is an array of Country objects. Refer to the Country for more details.
Methods
1. Upload Identity Document
To upload an identity document, just provide a properly configured UploadDocParam object as an argument to the uploadDoc()
method. Here's how:
const param = {
front_doc_base64: YOUR_FRONT_DOC;
back_doc_base64: YOUR_BACK_DOC;
doc_type: YOUR_DOC_TYPE;
issuing_country: YOUR_COUNTRY_ISO;
}
const result = await pwInstance.uploadDoc(param);
UploadDocParam
Parameter | Description |
---|---|
front_doc_uri | URI of the cropped front eKYC image, without the background |
front_doc_uri_full | URI of the full front eKYC image, including background |
back_doc_uri | URI of the cropped back eKYC image, without the background |
back_doc_uri_full | URI of the full back eKYC image, including background |
front_doc_base64 | Cropped front eKYC image in base64 format, without the background |
front_doc_base64_full | Full front eKYC image in base64 format, including background |
back_doc_base64 | Cropped Back eKYC image in base64 format, without the background |
back_doc_base64_full | Full Back eKYC image in base64 format, including background |
doc_type | Type of the document. (Possible values: passport, national_identity_document, driving_license) |
issuing_country*** | ISO2 country code corresponding to the doc_type |
Output
Property | Description |
---|---|
front_document_id | Unique ID of the front document |
back_document_id | Unique ID of the back document |
* For available issuing countries, please refer to the default issuing country and issuing country list. These resources will provide you with comprehensive information on the valid options you can use when specifying the issuing country** for your identity documents.
2. Upload Selfie
To upload a selfie, provide a properly configured UploadSelfieParam object as an argument to the uploadSelfie()
method:
const param = {
selfie_base64: YOUR_SELFIE;
liveness_score: YOUR_LIVENESS_SCORE;
}
const result = await pwInstance.uploadSelfie(param);
UploadSelfieParam
Parameter | Description |
---|---|
selfie_uri | URI of the cropped Selfie eKYC image, without background |
selfie_uri_full | URI of the full Selfie eKYC image, including background |
selfie_base64 | Cropped Selfie eKYC image in base64 format, without background |
selfie_base64_full | Full Selfie eKYC image in base64 format, including background |
liveness_score | Facial liveness detection score (Sample value: 0.623) |
Output
Property | Description |
---|---|
selfie_document_id | Unique ID of the selfie document |
3. Retrieve Verification Results
After completed the Upload Verification process, retrieve the verification results using the viewResult()
method. No arguments are required for this method:
const result = await pwInstance.viewResult();
Output
Property | Description |
---|---|
status | Status of all verification documents (Possible values: pending, approved, rejected, review) |
is_retriable | Indicates if the verification process can be retried |
id_status | Status of Identity document verification (Possible values: pending, approved, rejected, review) |
selfie_status | Status of selfie verification (Possible values: pending, approved, rejected, review) |
result | (Refer to DocResults) |
DocResults
Property | Description |
---|---|
full_name | Full name captured from the Identity document |
given_name | Given name captured from the Identity document |
surname | Surname captured from the Identity document |
id_number | Identity number captured from the Identity document |
date_of_birth | Date of birth captured from the Identity document |
gender | Gender from the Identity document (Possible values: FEMALE, MALE) |
line1 | First line of the address |
city | City of the address |
zip | Zip code of the address |
state_iso*** | State/region of the country in ISO2 format (Example: MY-01) |
state_name | State/region name of the country |
country_iso2*** | Country code in ISO2 format (Example: my, id) |
country_name | Country name |
*** For available states and countries, please refer to the state/region list and country list. These resources will provide you with comprehensive information on the valid options you can use when specifying the state and country.
4. Update Verification Result
After retrieving the verification results, you can update them using the updateForm()
method. Pass a properly configured UpdateFormParam object to update the results:
const param = {
full_name: YOUR_FULL_NAME,
id_number: YOUR_ID_NUMBER,
date_of_birth: YOUR_DATE_OF_BIRTH,
address: YOUR_ADDRESS,
...
};
const result = await pwInstance.updateForm(param);
UpdateFormParam
Property | Description |
---|---|
full_name*** | Full name captured from the Identity document |
given_name*** | Given name captured from the Identity document |
surname*** | Surname captured from the Identity document |
id_number | Identity number captured from the Identity document |
date_of_birth | Date of birth captured from the Identity document |
gender | Gender from the Identity document (Possible values: FEMALE, MALE) |
line1 | First line of the address |
city | City of the address |
zip | Zip code of the address |
state_iso*** | State/region of the country in ISO2 format (Example: MY-01) |
country_iso2*** | Country code in ISO2 format (Example: my, id) |
*** Either full_name
is required, or both given_name
and surname
are required.
Output
Property | Description |
---|---|
result | Status of update verification result (Possible values: true, false) |
5. Retrieve State / Region List
Retrieve the states by passing the country code in ISO2 format as an argument to the fetchStates()
method:
const states = await pwInstance.fetchStates(YOUR_COUNTRY_ISO);
Output
Property | Description |
---|---|
iso_code | State/region of the country in ISO2 format (Example: MY-01) |
name | Full name of state (Example: Selangor, Kuala Lumpur) |
Acknowledgements
We extend our gratitude to the following open-source projects that greatly contributed to the development of the Pipwave eKYC SDK: webpack
, axios
, jwt-decode
Thank you to these remarkable projects and their dedicated teams for making our SDK possible. Your efforts are truly appreciated.
2 months ago
3 months ago
3 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago