asliri-comprehensive-liveness-jquery

2.0.1 • Public • Published

ASLIRI - COMPREHENSIVE LIVENESS - WEB SDK (jQuery & HTML)

Description

You can verification face and eye with comprehensive liveness by ASLIRI.
The SDK support for HTML

Check out the SDK for a simplified integration.

1. Copy wasm folder to project directory

  • wasm folder provided by ASLIRI
  • copy to yourproject/copyhere...


2. Get your token with ASLIRI Team


3. Install Library if you're not using NPM

library will provided by ASLIRI Team as zip file
you can extract and put 'libs' folder in your project

example: C://webserver/yourproject/libs

sample in index.html :

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <script src="libs/jquery/dist/jquery.min.js"></script>
        <script type="module" src="libs/asliri-acu-component/face.umd.js"></script>
        <script type="module" src="libs/asliri-acu-component/comprehensive-liveness.umd.js"></script>
        <script type="module" src="libs/asliri-mg-component/index.umd.js"></script>
        <script src="libs/asliri-comprehensive-liveness-jquery/dist/asliri-comprehensive-liveness-sdk.js"></script>
        <style type="text/css">
            body {
                margin: 0;
                padding: 0;
            }
        </style>

        <title>HTML Integration Sample</title>
    </head>

    <body>
        <div id="app">
            <div id="comprehensiveliveness"></div>
        </div>
    </body>

    <script type="text/javascript">
        async function ComprehensiveLivenessInitial() {
            const getAuth = await window.COMPREHENSIVE_SDK.CheckAuthentication(
                "Provided by ASLIRI Team"
            );

            window.COMPREHENSIVE_SDK.ComprehensiveLiveness(
                getAuth,
                (result) => {
                    // your code for handle result
                    // result.message = message response
                    // result.score = score liveness 0 to 1
                    // result.image = image base64
                    console.log({ result });
                },
                (error) => {
                    // your code for handle error
                    console.log({ error });
                }
            );
        }

        // run comprehensive liveness
        ComprehensiveLivenessInitial();
    </script>
</html>


4. Install Library if you're using NPM

npm i asliri-comprehensive-liveness-jquery --save

sample in index.html :

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <script src="node_modules/jquery/dist/jquery.min.js"></script>
        <script type="module" src="node_modules/asliri-acu-component/face.umd.js"></script>
        <script type="module" src="node_modules/asliri-acu-component/comprehensive-liveness.umd.js"></script>
        <script type="module" src="node_modules/asliri-mg-component/index.umd.js"></script>
        <script src="node_modules/asliri-comprehensive-liveness-jquery/dist/asliri-comprehensive-liveness-sdk.js"></script>
        <style type="text/css">
            body {
                margin: 0;
                padding: 0;
            }
        </style>

        <title>HTML Integration Sample</title>
    </head>

    <body>
        <div id="app">
            <div id="comprehensiveliveness"></div>
        </div>
    </body>

    <script type="text/javascript">
        async function ComprehensiveLivenessInitial() {
            const getAuth = await window.COMPREHENSIVE_SDK.CheckAuthentication(
                "Provided by ASLIRI Team"
            );

            window.COMPREHENSIVE_SDK.ComprehensiveLiveness(
                getAuth,
                (result) => {
                    // your code for handle result
                    // result.message = message response
                    // result.score = score liveness 0 to 1
                    // result.image = image base64
                    console.log({ result });
                },
                (error) => {
                    // your code for handle error
                    console.log({ error });
                }
            );
        }

        // run comprehensive liveness
        ComprehensiveLivenessInitial();
    </script>
</html>

Note: result score from 0 to 1 (you can manage the score)

Thank you.

Readme

Keywords

Package Sidebar

Install

npm i asliri-comprehensive-liveness-jquery

Weekly Downloads

1

Version

2.0.1

License

MIT

Unpacked Size

28.3 kB

Total Files

3

Last publish

Collaborators

  • asliri