0.1.19 • Published 8 months ago

youverify-liveness-web v0.1.19

Weekly downloads
-
License
-
Repository
-
Last release
8 months ago

Youverify Livess Web SDK

Software Development Kit for Youverify's Liveness Check

Installation

To install, run one of the following commands:

npm install youverify-liveness-web

or

yarn add youverify-liveness-web

Usage

  1. Import the package into your web page like so:
import YouverifyLiveness from "youverify-liveness-web";
  1. Initialize an instance of the package, like so:
const yvLiveness = new YouverifyLiveness(options);

For a list of the valid options, check this out

  1. Start the process, like so:
yvLiveness.start();

This could also be called with an array of tasks. The supplied tasks override those provided during initialization.

const tasks = [{ id: "complete-the-circle" }];
yvLiveness.start(tasks);

Full Example:

import YouverifyLiveness from "youverify-liveness-web";

try {
  const yvLiveness = new YouverifyLiveness({
    tasks: [{ id: "complete-the-circle" }],
  });
  yvLiveness.start();
} catch (error) {
  // Handle Validation Errors
  console.log(`Something isn't right, ${error}`);
}

Options

OptionTypeRequiredDescriptionDefault ValuePossible Values
presentationStringNoControls how UI is displayedmodalmodal, page
sandboxEnvironmentBooleanNoSets whether session should run in sandbox or live modetruetrue, false
tasksArrayNoSets tasks that need to be performed for liveness to be confirmedundefinedSee tasks
userObjectNoSets details of user for which liveness check is being performedundefinedSee nested options below
user.firstNameStringYesFirst name of user-Any string
user.lastNameStringNoLast name of userundefinedAny string
user.emailStringNoEmail of userundefinedAny string
brandingObjectNoCustomizes UI to fit your brandundefinedSee nested options below
branding.colorStringNoSets your branding colorundefinedValid hex or RGB string
branding.logoStringNoSets your logoundefinedValid image link
allowAudioBooleanNoSets whether to narrate information to user during tasksfalsetrue, false
onCloseFunctionNoCallback function that gets triggered when modal is closedundefinedAny valid function
onSuccessFunctionNoCallback function that gets triggered when all tasks have been completed and passed. Called with completion dataundefinedAny valid function
onFailureFunctionNoCallback function that gets triggered when at least one task fails. Called with completion dataundefinedAny valid function

Tasks

A task is a series of instructions for users to follow to confirm liveness. Find below a list of tasks.

PS: We aim to frequently add to this list a variety of fun and yet intuitive ways of confirming liveness, so be on the lookout for more tasks!

Complete The Circle

User passes task by completing imaginary circle with head movement.

Options

OptionTypeRequiredDescriptionDefault ValuePossible Values
idStringYesId of task-complete-the-circle
difficultyStringNoSets difficulty of taskmediumeasy, medium, hard
timeoutNumberNoSets time in milliseconds after which task automatically failsundefinedAny number in milliseconds

Yes Or No

User passes task by answering a list of arbitrary questions set by you with the tilting of the head; right for a yes and left for a no.

Options

OptionTypeRequiredDescriptionDefault ValuePossible Values
idStringYesId of task-yes-or-no
difficultyStringNoSets difficulty of taskmediumeasy, medium, hard
timeoutNumberNoSets time in milliseconds after which task automatically failsundefinedAny number in milliseconds
questionsArrayNoA set of questions to ask userundefinedSee nested options below
questions.questionStringYesQuestion to ask user. Should be a true or false type question. Eg: "Are you ready"-Any string
questions.answerBooleanYesAnswer to the question-true, false
questions.errorMessageStringNoError message to display if user gets question wrongundefinedAny string

Motions

User passes task by performing random motions in random sequences, which include nodding, blinking and opening of mouth.

Options

OptionTypeRequiredDescriptionDefault ValuePossible Values
idStringYesId of task-motions
difficultyStringNoSets difficulty of taskmediumeasy, medium, hard
timeoutNumberNoSets time in milliseconds after which task automatically failsundefinedAny number in milliseconds
maxNodsNumberNoMaximum amount of nods a user is asked to perform5Any number
maxBlinksNumberNoMaximum amount of nods a user is asked to perform5Any number

Callback Data

The onSuccess and onFailure callbacks (if supplied) are passed the following data:

OptionTypeDescription
dataObjectData passed through callback
data.faceImageStringFace Image of user performing liveness check
data.livenessClipStringVideo of user performing liveness check
data.passedBooleanIndicator on whether liveness check passed or failed
data.metadataAnyMetadata passed in during initialization

Credits

This SDK is developed and maintained solely by Youverify

0.1.19

8 months ago

0.1.13

10 months ago

0.1.14

10 months ago

0.1.15

10 months ago

0.1.16

9 months ago

0.1.17

9 months ago

0.1.18

8 months ago

0.1.12

10 months ago

0.1.11

10 months ago

0.1.10

10 months ago

0.1.9

10 months ago

0.1.8

10 months ago

0.1.7

11 months ago

0.1.6

11 months ago

0.1.5

11 months ago

0.1.4

11 months ago

0.1.3

11 months ago

0.1.2

11 months ago

0.1.1

11 months ago

0.1.0

11 months ago