npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

progeny-sdk-web

v1.6.3

Published

This is a library for progeny endpoints

Downloads

9

Readme

Progeny SDK

How to use

npm install progeny-sdk-web
import ProgenySDK from 'progeny-sdk-web'

Add required markup

This will serve as containers to the markup the SDK will generate. This way, you can control where to display it on your layout.

A. If using the SDK without the preset buttons. The endpoint functionalities are triggered manually by calling the SDK functions.

<div id="progeny-sdk-loader"></div>
<div id="progeny-sdk-camera"></div>
<div id="progeny-sdk-document-options"></div>
<div id="progeny-sdk-upload-scan-options"></div>
<div id="progeny-sdk-aml"></div>
<div id="progeny-sdk-upload"></div>

B. If using the SDK with the preset buttons. The endpoint functionalities are triggered by just clicking on the preset buttons.

<div id="progeny-sdk-loader"></div>
<div id="progeny-sdk-camera"></div>
<div id="progeny-sdk-document-options"></div>
<div id="progeny-sdk-upload-scan-options"></div>
<div id="progeny-sdk-aml"></div>
<div id="progeny-sdk-upload"></div>
<div id="progeny-sdk-buttons"></div>

Create an instance of the SDK entrypoint

-Instantiate the SDK entrypoint -Set the endpoints base url -Set a callback that will provide the results of the token request transaction and return the -received token back to the SDK.

const sdk = new ProgenySDK('endpoints_base_url', async () => {   
    const accessToken = await getToken();
    return accessToken;
});

await getToken() in this case, calls server-side code that handles the token request transactions.

The token callback function is a means to hide and secure token request transactions from the browser client. It is advised that token request transactions are handled on the server (e.g PHP, NodeJS, Python) so that account credentials are not exposed to the browser client.

See the documentation on how to request for tokens https://docs.progeny.tech/our-api/token-obtain.

-call the initializeMarkUp function to generate the layout. (Make sure required markups are already loaded)

sdk.initializeMarkUp();

If using the SDK with preset buttons Add a third parameter to the SDK instance which will serve as the response callback. This response callback will be your listener for the responses received.

const sdk = new ProgenySDK(
'base_url', 
()=>{ //token callback }, 
(res)=>{ //response callback }
);

AIRSNAP

The selfie camera is using our Airsnap SDK which serves as a guide on how to properly position your face on the camera. To make the Airsnap work, follow the instructions below:

1. Navigate to package directory (node_modules/progeny-sdk-web/dist/public)
2. Copy these files and paste it to you client side dist or public folder
   a. liveface.data
   b. liveface.wasm

While the airsnap is evaluating the face, it consumes device memory resources. Thus, it will make the app crash once memory is out of bounds. This happens specially when a user takes time to capture a face. We created a function to handle this airsnap error. (By default when airsnap stops working because of memory out of bounds error, we switch to manual capture).

sdk.onAirsnapError=() => {
    setTimeout(() => {
      do anything here
    }, 2000)
}

We strongly advise to reload the page for airsnap to clean memory usage. Add these two functions on your consuming app and make sure to place it after sdk.initializeMarkUp()

Example on vue js app:
    mounted() {
        sdk.initializeMarkUp();
        sdk.liveness().then((response) => {
            //handle response here
        }).catch((err) => {   
            //handle error here
        });
        sdk.onAirsnapError=() => {
            console.log('Airsnap Error')
            setTimeout(() => {
            window.location.reload();
            }, 2000)
        }
    }

SDK functions

Liveness

example on React App:

const liveness = () => {
    sdk.liveness().then((response) => {
        //handle response here
    }).catch((err) => {   
         //handle error here
    });
}
<button onClick={liveness}>Liveness</button>

Register

example on React App:

const register = () => {
    sdk.register().then((response) => {
        //handle response here
    }).catch((err) => {   
        //handle error here
    });
}
<button onClick={register}>Register</button>

Authorize

example on React App:

const authorize = (uuid) => {
    sdk.authorize(uuid).then((response) => {
        //handle response here
    }).catch((err) => {   
        //handle error here
    });
}
<button onClick={() => authorize(uuid)}>Authorize</button>

KYC

example on React App: KYC without AML

const kyc = () => {
    sdk.kyc().then((response) => {
        //handle response here
    }).catch((err) => {   
        //handle error here
    });
}
<button onClick={kyc}>Kyc</button>

KYC with AML

const kyc = () => {
    sdk.kyc({ aml: true }).then((response) => {
        //handle response here
    }).catch((err) => {   
        //handle error here
    });
}
<button onClick={kyc}>Kyc</button>

Passport OCR

example on React App:

const passportOcr = () => {
    sdk.ocrPassport().then((response) => {
        //handle response here
    }).catch((err) => {   
        //handle error here
    });
}
<button onClick={passportOcr}>Passport OCR</button>

ID OCR

example on React App:

const idOcr = () => {
    sdk.ocrId().then((response) => {
        //handle response here
    }).catch((err) => {   
        //handle error here
    });
}
<button onClick={idOcr}>Id OCR</button>

AML (Background Check)

example on React App:

const aml = () => {
    sdk.aml().then((response) => {
        //handle response here
    }).catch((err) => {   
        //handle error here
    });
}
<button onClick={aml}>AML</button>

Face Search

example on React App:

const faceSearch = () => {
    sdk.faceSearch().then((response) => {
        //handle response here
    }).catch((err) => {   
        //handle error here
    });
}
<button onClick={faceSearch}>Face Search</button>

Stop Camera

For SPA applications, make sure to stop camera stream when component is unmounted.

    sdk.stopCamera();