Module: verid

Classes

AuthenticationSessionSettings
LivenessDetectionSessionSettings
RegistrationSessionSettings
SessionResult
SessionSettings

Members

(static, readonly) Bearing :string

Constants representing the bearing of a face looking at the camera
Type:
  • string
Properties:
Name Type Description
STRAIGHT string Facing the camera straight on
UP string Looking up
RIGHT_UP string Looking right and up
RIGHT string Looking right
RIGHT_DOWN string Looking right and down
DOWN string Looking down
LEFT_DOWN string Looking left and down
LEFT string Looking left
LEFT_UP string Looking left and up
Source:

(static, readonly) LivenessDetection :string

Constants representing liveness detection settings
Type:
  • string
Properties:
Name Type Description
NONE string No liveness detection
REGULAR string Regular liveness detection
STRICT string Strict liveness detection (requires the user to register additional bearings)
Source:

(static, readonly) SessionOutcome :string

Constants representing the outcome of a Ver-ID session
Type:
  • string
Properties:
Name Type Description
SUCCESS string The session succeeded in registering or authenticating the user.
FAIL_NUMBER_OF_RESULTS string The session failed because it didn't gather enough valid images before it timed out.
UNKNOWN_FAILURE string The session failed.
CANCEL string The session was cancelled by the user.
FAIL_ANTI_SPOOFING_CHALLENGE string The session failed because it failed the anti-spoofing challenge.
FAIL_HOST_AUTHENTICATION string The session failed because the app hasn't authenticated to use the Ver-ID API. Only applies to the demo version of the Ver-ID library.
DET_REC_LIB_FAILURE string Failed because of an exception thrown by the face detection and recognition library.
FACE_LOST string Face was detected but the user moved away from the camera.
NOT_AUTHENTICATED string User passed liveness detection but the face cannot be authenticated.
Source:

Methods

(static) authenticate(settingsopt, callbackopt, errorCallbackopt) → {Promise.<module:verid.SessionResult>}

Authenticate user
Parameters:
Name Type Attributes Description
settings module:verid.AuthenticationSessionSettings <optional>
An instance of AuthenticationSessionSettings
callback module:verid~SessionCallback <optional>
Function to be called if the authentication session completes
errorCallback function <optional>
Function to be called if the session fails
Source:
Returns:
If callback is not specified returns a promise
Type
Promise.<module:verid.SessionResult>

(static) captureLiveFace(settingsopt, callbackopt, errorCallbackopt) → {Promise.<module:verid.SessionResult>}

Capture live face
Parameters:
Name Type Attributes Description
settings module:verid.LivenessDetectionSessionSettings <optional>
An instance of LivenessDetectionSessionSettings
callback module:verid~SessionCallback <optional>
Function to be called if the liveness detection session completes
errorCallback function <optional>
Function to be called if the session fails
Source:
Returns:
If callback is not specified returns a promise
Type
Promise.<module:verid.SessionResult>

(static) compareFaceTemplates(template1, template2, callback, errorCallback)

Compare face templates
Parameters:
Name Type Description
template1 module:verid~FaceTemplate Face template to compare to the other template
template2 module:verid~FaceTemplate Face template to compare to the first template
callback module:verid~CompareFacesCallback Called when the comparison succeeds
errorCallback function Called if the comparison fails
Source:

(static) deleteUser(userId, callbackopt, errorCallbackopt) → {Promise}

Delete a registered user
Parameters:
Name Type Attributes Description
userId string The id of the user to delete.
callback function <optional>
Function to be called if the operation succeeds.
errorCallback function <optional>
Function to be called if the operation fails.
Source:
Returns:
If callback is not specified returns a promise
Type
Promise

(static) detectFaceInImage(image, callback, errorCallback)

Detect face in image
Parameters:
Name Type Description
image string Data URL scheme image, e.g. data:image/jpeg;base64,encodedImageData
callback module:verid~DetectFaceCallback Callback when face is detected
errorCallback function Error callback
Source:

(static) getRegisteredUsers(callbackopt, errorCallbackopt) → {Promise.<Array.<string>>}

Retrieve a list of registered users
Parameters:
Name Type Attributes Description
callback module:verid~UserCallback <optional>
Function to be called if the opration succeeds. The response will be an array of objects with a string member "userId" and an array member "bearings" with int members corresponding to the user's registered bearings as defined by the Bearing constants.
errorCallback function <optional>
Function to be called if the operation fails.
Source:
Returns:
If callback is not specified returns a promise
Type
Promise.<Array.<string>>

(static) load(apiSecretopt, callbackopt, errorCallbackopt) → {Promise}

Load Ver-ID
Parameters:
Name Type Attributes Description
apiSecret string <optional>
API secret obtained at https://dev.ver-id.com/admin/register. If you omit this parameter you must specify the API secret in your app's Info.plist file (iOS) or manifest.xml (Android).
callback function <optional>
Function to be called when the Ver-ID load operation finishes
errorCallback function <optional>
Function to be called if the load operation fails
Source:
Returns:
If callback is not specified the function returns a promise
Type
Promise

(static) register(settingsopt, callbackopt, errorCallbackopt) → {Promise.<module:verid.SessionResult>}

Register user
Parameters:
Name Type Attributes Description
settings module:verid.RegistrationSessionSettings <optional>
An instance of RegistrationSessionSettings
callback module:verid~SessionCallback <optional>
Function to be called if the registration session finishes
errorCallback function <optional>
Function to be called if the registration session fails
Source:
Returns:
If callback is not specified returns a promise
Type
Promise.<module:verid.SessionResult>

(static) unload()

Unload Ver-ID Call this function to free resources when your app no longer requires Ver-ID
Source:

Type Definitions

CompareFacesCallback(score)

Called after face template comparison
Parameters:
Name Type Description
score number Score between 0.0 and 1.0 indicating the similarity between the two templates: 0 = different, 1 = very similar
Source:

DetectFaceCallback(face)

Called when face is detected in image
Parameters:
Name Type Description
face module:verid~Face Detected face
Source:

Face

Type:
  • Object
Properties:
Name Type Attributes Description
x number Distance in pixels from the left edge of the image
y number Distance in pixels from the top edge of the image
width number Width of the face in pixels
height number Height of the face in pixels
yaw number Yaw angle of the face in degrees
pitch number Pitch angle of the face in degrees
roll number Roll angle of the face in degrees
faceTemplate module:verid~FaceTemplate <optional>
Face template in portable format
Source:

FaceTemplate

Type:
  • Object
Properties:
Name Type Description
version integer Version of the template model
data string Base 64 encoded binary representation of the face
Source:

SessionCallback(result)

Parameters:
Name Type Description
result module:verid.SessionResult Result of the session
Source:

User

Type:
  • Object
Properties:
Name Type Description
userId string User ID
bearings Array.<module:verid.Bearing> Registered (face bearings)[#verid.Bearing]
Source:

UserCallback(users)

Parameters:
Name Type Description
users Array.<string> Registered users
Source: