# asliri-comprehensive-liveness-react-beta

> ASLIRI comprehensive Liveness for React Component

Latest version **0.0.6** (published 2024-02-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install asliri-comprehensive-liveness-react-beta
pnpm add asliri-comprehensive-liveness-react-beta
yarn add asliri-comprehensive-liveness-react-beta
bun add asliri-comprehensive-liveness-react-beta
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2024-02-05 |
| First published | 2023-12-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 33.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | asliri.id |
| Maintainers | asliri |
| Keywords | asliri |

## Links

- npm: https://www.npmjs.com/package/asliri-comprehensive-liveness-react-beta
- npm.io page: https://npm.io/package/asliri-comprehensive-liveness-react-beta

## Dependencies (3)

- [js-base64](https://npm.io/package/js-base64.md) ^3.7.5
- [asliri-mg-component](https://npm.io/package/asliri-mg-component.md) ^3.0.0
- [asliri-acu-component](https://npm.io/package/asliri-acu-component.md) ^3.0.0

## Recent versions

- 0.0.6 (latest) — 2024-02-05
- 0.0.5 — 2024-01-03
- 0.0.4 — 2024-01-02
- 0.0.3 — 2024-01-02
- 0.0.2 — 2023-12-15
- 0.0.1 — 2023-12-15

## README

# ASLIRI - COMPREHENSIVE LIVENESS - WEB SDK (React Component) (Beta Version)

#### This SDK for POC or testing integration development

## Description

You can verification face and eye with comprehensive liveness by ASLIRI.
<br/>
The SDK support for <b>ReactJS / NextJS</b>
<br/>

## Check out the SDK for a simplified integration.

### 1. Copy wasm folder to public directory
- wasm folder provided by ASLIRI 
- copy to projectname/public/**copyhere...**
<br/>
<br/>

### 2. Get your token with ASLIRI Team
<br/>

### 3. Install Library via NPM

```cmd
npm i asliri-comprehensive-liveness-react-beta --save
```

#### sample in App.tsx :

```js

import { useEffect, useState } from 'react'

import { CheckAuthentication, ComprehensiveLiveness } from "asliri-comprehensive-liveness-react-beta"

function App() {

  const result = (result:any) => {
    console.log(result.score); // score liveness
    console.log(result.message); // message response 
    console.log(result.image); // image base64
  };

  const handleError = (err: string) => {
    console.log({ err });
  };

  const [auth, setAuth] = useState("");
  const [apiCalled, setApiCalled] = useState(false);

  const getAuth = async () => {
    const getAuthenticationResult = await CheckAuthentication(
      "provided by ASLIRI"
    );
    setAuth(getAuthenticationResult);

    console.log({ getAuthenticationResult });
  };

  useEffect(() => {
    setApiCalled(true);
  }, []);

  useEffect(() => {
    if (apiCalled) {
      getAuth();
    }
  }, [apiCalled]);

  return (
    <>
      <div>
        <ComprehensiveLiveness
          getAuthentication={auth}
          getResult={result}
          handleError={handleError}
        ></ComprehensiveLiveness>
      </div>
    </>
  );
}

export default App



```

#### sample in App.js :

```js

import { useEffect, useState } from 'react'

import { CheckAuthentication, ComprehensiveLiveness } from "asliri-comprehensive-liveness-react-beta"

function App() {

  const result = (result) => {
    console.log(result.score); // score liveness
    console.log(result.message); // message response 
    console.log(result.image); // image base64
  };

  const handleError = (err) => {
    console.log({ err });
  };

  const [auth, setAuth] = useState("");
  const [apiCalled, setApiCalled] = useState(false);

  const getAuth = async () => {
    const getAuthenticationResult = await CheckAuthentication(
      "provided by ASLIRI"
    );
    setAuth(getAuthenticationResult);

    console.log({ getAuthenticationResult });
  };

  useEffect(() => {
    setApiCalled(true);
  }, []);

  useEffect(() => {
    if (apiCalled) {
      getAuth();
    }
  }, [apiCalled]);

  return (
    <>
      <div>
        <ComprehensiveLiveness
          getAuthentication={auth}
          getResult={result}
          handleError={handleError}
        ></ComprehensiveLiveness>
      </div>
    </>
  );
}

export default App


```

Thank you.

<blockquote>
Note: result score from 0 to 1 (you can manage the score)
</blockquote>

<br/>
<br/>

## Version History

### 0.0.6

* Update component

### 0.0.5

* Result with object {message, score, image}

### 0.0.4

* Bugfix something error

### 0.0.3

* Result with object {message, score}

### 0.0.2 

* Bug Fix Load ACU component

### 0.0.1 

* Initial release

---
_Source: https://npm.io/package/asliri-comprehensive-liveness-react-beta · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
