iblock-verifier
v1.1.0
Published
Integration Library for IdentityBlock Person Verification Platform
Downloads
5
Readme
'iblock-verifier'
API to integrate the personal verification middleware in the web applications.
Uses 'iBlock Mobile Application' to verify the digital identity from user's end.
How to use
Install the 'iblock-verifier' package on your backend server source code using
npm install iblock-verifier
Include the following variables in your .env
file, or in the environment variables where your server is hosted. Refer the .env.example
inside the 'iblock-verifier' package in the node modules folder.
FUNDING_ACCOUNT="**private key of the account used to fund the newly created accounts **"
Integrate the below explained functions to use the 'iBlock Person Verification Platform' in your web server.
If you are restoring the integration of 'iBlock Person Verification Platform', add the following fields to your .env
with the details of your already deployed smart contract addresses.
IBLOCK_VERIFIER_PRIVATE_KEY
IBLOCK_VERIFIER_ADDRESS
IBLOCK_VERIFIER_CONTRACT_ADDRESS
Refer .env.example
file for the format.
Functions
loadContract() ⇒ JSON
Load ( or deploy and load) the smart contract tied to the verifier.
Read the contract address from the 'deployed-contract' file, or deploy a new contract if the 'deployed-contract' file is not present.
Kind: global function
Returns: JSON - {
private-key:{String} - Private key of the Ethereum Account Address of the verifier,
verifier-address: {String} - Ethereum Account Address of the verifier,
contract-address: {String} - Smart Contract address of the verifier
}.
getQR(_verifierName) ⇒ JSON
Get the QR code generated in the format accepted by the 'iBlock Mobile Application'.
Kind: global function
Returns: JSON - {
qr: {String} - QR code URI that contains the verifier details,
token: {String} - unique token to the verification
}.
| Param | Type | Description | | -------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------- | | _verifierName | String | The name of the verifying institution. Will be prompted to the user who scans the QR code using the 'iBlock Mobile Application'. |
getTokenVerified(_token, _listOfDataFields) ⇒ JSON
Get the personal details of a user who scanned and approved a QR code with the given token.
If the transaction is not succeeded yet, return "PENDING" as status.
If the user has rejected permission, return "REJECTED" as status.
Kind: global function
Returns: JSON - {
status: {String} - status of the verification. "PENDING" or "APPROVED" or "REJECTED",
data(optional): {JSON} - user's data fields fetched from blockchain, only applicable if status is APPROVED.
}
| Param | Type | Description | | ------------------ | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | _token | String | A token previously generated using the 'iblock-verifier package' to identify the verification transaction. | | _listOfDataFields | Array.<String> | A list of data fields of users which need to be fetched from the blockchain currently allows the set of ["name","email","DOB","country","mobile","gender"] only. |