progeny-sdk
v1.0.0
Published
This is a library for progeny endpoints
Downloads
2
Readme
Progeny SDK
1. How to use
import ProgenySDK from 'progeny-sdk'
2. Add required markup
This will served as containers to the markup the sdk will generate. This way, you can control where to display it on your layout
<div id="progeny-sdk-loader"></div>
<div id="progeny-sdk-camera"></div>
<div id="progeny-sdk-document-options"></div>
if you want to use our preset buttons, add this mark up
<div id="progeny-sdk-buttons"></div>
3. Create an instance of the class
If you don't use our preset buttons
Create an instance of the class.
const sdk = new ProgenySDK('base_url', 'username', 'password');
Call the initializeMarkUp function to generate the layout
sdk.initializeMarkUp();
If you want to use out preset buttons
create a responseCallback function, the responseCallback function will hold the response returned by api
const responseCallback = (response) => {
//do anything on the (response) here
}
Create an instance of the class. Add the responseCallback function as an argument
const sdk = new ProgenySDK('base_url', 'username', 'password', responseCallback);
Call the initializeMarkUp function to generate the layout
sdk.initializeMarkUp();
How to use the functionalities
This only applies if you want to call the functionalities after an event or something (depends on how you need it)
Liveness
example on React App:
const liveness = () => {
sdk.liveness().then((response) => {
//do anything on the (response) here
});
}
<button onClick={liveness}>Liveness</button>
Register
example on React App:
const register = () => {
sdk.register().then((response) => {
//do anything on the (response) here
});
}
<button onClick={register}>Register</button>
Authorize
example on React App:
const authorize = () => {
sdk.authorize().then((response) => {
//do anything on the (response) here
});
}
<button onClick={authorize}>Authorize</button>
Kyc
example on React App:
const kyc = () => {
sdk.kyc().then((response) => {
//do anything on the (response) here
});
}
<button onClick={kyc}>Kyc</button>