Constructor
new Biometric(apiKeyopt)
Create a new Biometric API client.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
apiKey |
string | null |
<optional> |
null | Your API key. If omitted, the `IDANALYZER_KEY` environment variable is used. |
- Source:
Extends
Methods
getApiKey(customKeyopt) → {string|null}
Resolve the API key, preferring the provided value and falling back to
the `IDANALYZER_KEY` environment variable.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
customKey |
string | null |
<optional> |
null | Explicitly supplied API key. |
- Overrides:
- Source:
Returns:
The resolved API key, or `null` if none is available.
- Type
- string | null
setCustomData(customData) → {void}
Set an arbitrary string you wish to save with the transaction. e.g Internal customer reference number
Parameters:
| Name | Type | Description |
|---|---|---|
customData |
string | Arbitrary string to store alongside the transaction. |
- Source:
Returns:
- Type
- void
setParam(key, value) → {void}
Set an API parameter and its value, this function allows you to set any API parameter without using the built-in functions
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | Parameter key |
value |
* | Parameter value |
- Overrides:
- Source:
Returns:
- Type
- void
setProfile(profile) → {void}
Set KYC Profile
Parameters:
| Name | Type | Description |
|---|---|---|
profile |
Profile | KYC Profile object. |
- Source:
Throws:
-
If `profile` is not a Profile instance.
Returns:
- Type
- void
throwApiException(swopt) → {void}
Whether an exception should be thrown if API response contains an error message
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
sw |
boolean |
<optional> |
false | Set to `true` to throw an APIError when the API response contains an error, or `false` to return the raw error response instead. |
- Overrides:
- Source:
Returns:
- Type
- void
(async) verifyFace(referenceFaceImageopt, facePhotoopt, faceVideoopt) → {Promise.<ApiResponse>}
Perform 1:1 face verification using selfie photo or selfie video, against a reference face image.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
referenceFaceImage |
string |
<optional> |
'' | Reference face image / front of document (file path, base64 content, URL, or cache reference). |
facePhoto |
string |
<optional> |
"" | Face Photo (file path, base64 content or URL, or cache reference). Provide either this or `faceVideo`. |
faceVideo |
string |
<optional> |
"" | Face Video (file path, base64 content or URL). Used if `facePhoto` is empty. |
- Source:
Throws:
-
If no profile is configured, the reference image is missing, or no verification face is supplied.
Returns:
The parsed API response.
- Type
- Promise.<ApiResponse>
(async) verifyLiveness(facePhotoopt, faceVideoopt) → {Promise.<ApiResponse>}
Perform standalone liveness check on a selfie photo or video.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
facePhoto |
string |
<optional> |
"" | Face Photo (file path, base64 content or URL, or cache reference). Provide either this or `faceVideo`. |
faceVideo |
string |
<optional> |
"" | Face Video (file path, base64 content or URL). Used if `facePhoto` is empty. |
- Source:
Throws:
-
If no profile is configured or no face image/video is supplied.
Returns:
The parsed API response.
- Type
- Promise.<ApiResponse>