# Facematch & Liveness

## Facematch

### The method use to Start Facematch is

```
accura.startFaceMatch(accuraConfs, config, function (result), function (error));
```

### *Parameters:*

**accuraConfs**: JSON Object

* enableLogs: Boolean
* with\_face: Boolean
* face\_uri: URI

**config**: JSON Object

* feedbackTextSize: integer
* feedBackframeMessage: String
* feedBackAwayMessage: String
* feedBackOpenEyesMessage: String
* feedBackCloserMessage: String
* feedBackCenterMessage: String
* feedBackMultipleFaceMessage: String
* feedBackHeadStraightMessage: String
* feedBackBlurFaceMessage: String
* feedBackGlareFaceMessage: String
* setBlurPercentage: integer
* setGlarePercentage\_0: integer
* setGlarePercentage\_1: integer

### Response:

**Success**: JSON Response {with\_face: Boolean,status: Boolean,detect: URI? (when with\_face = true),img\_1: URI? (when with\_face = false),img\_2: URI? (when with\_face = false),score: Float}\
**Error**: String

#### Example function:

<pre><code>function startFaceMatch() {

     var accuraConfs = {with_face: true, face_uri: facematchURI};
     var config = {
         feedbackTextSize: 18,
         feedBackframeMessage: 'Frame Your Face',
         feedBackAwayMessage: 'Move Phone Away',
         feedBackOpenEyesMessage: 'Keep Your Eyes Open',
         feedBackCloserMessage: 'Move Phone Closer',
         feedBackCenterMessage: 'Move Phone Center',
         feedBackMultipleFaceMessage: 'Multiple Face Detected',
         feedBackHeadStraightMessage: 'Keep Your Head Straight',
         feedBackBlurFaceMessage: 'Blur Detected Over Face',
         feedBackGlareFaceMessage: 'Glare Detected',
         // &#x3C;!--// 0 for clean face and 100 for Blurry face or set it -1 to remove blur filter-->
         setBlurPercentage: 80,
         // &#x3C;!--// Set min percentage for glare or set it -1 to remove glare filter-->
         setGlarePercentage_0: -1,
         setGlarePercentage_1: -1,
     };
     accura.startFaceMatch(accuraConfs, config, function (result) {
           //Result from the SDK
<strong>     }, function (error) {
</strong>          alert(error);
     });
}
</code></pre>

## Liveness

### The method use to Start Liveness is

```
accura.startLiveness(accuraConfs, config, function (result), function (error));
```

### *Parameters:*

**accuraConfs**: JSON Object

* enableLogs: Boolean
* with\_face: Boolean
* face\_uri: 'uri of face'

**config**: JSON Object

* feedbackTextSize: integer
* feedBackframeMessage: String
* feedBackAwayMessage: String
* feedBackOpenEyesMessage: String
* feedBackCloserMessage: String
* feedBackCenterMessage: String
* feedBackMultipleFaceMessage: String
* feedBackHeadStraightMessage: String
* feedBackBlurFaceMessage: String
* feedBackGlareFaceMessage: String
* setBlurPercentage: integer
* setGlarePercentage\_0: integer
* setGlarePercentage\_1: integer
* isSaveImage: Boolean
* liveness\_url: URL **(Require)**
* contentType: String
* feedBackLowLightMessage: String
* feedbackLowLightTolerence: integer,
* feedBackStartMessage: String
* feedBackLookLeftMessage: String
* feedBackLookRightMessage: String
* feedBackOralInfoMessage: String
* enableOralVerification: Boolean,
* codeTextColor: String

### Response:

**Success**: JSON Response {with\_face: Boolean, status: Boolean, detect: URI?, image\_uri: URI?, fm\_score: Float?, score: Float}\
**Error**: String

#### Example function:

```
function startLiveness() {
     var accuraConfs = {with_face: true, face_uri: facematchURI};
     var config = {
         feedbackTextSize: 18,
         feedBackframeMessage: 'Frame Your Face',
         feedBackAwayMessage: 'Move Phone Away',
         feedBackOpenEyesMessage: 'Keep Your Eyes Open',
         feedBackCloserMessage: 'Move Phone Closer',
         feedBackCenterMessage: 'Move Phone Center',
         feedBackMultipleFaceMessage: 'Multiple Face Detected',
         feedBackHeadStraightMessage: 'Keep Your Head Straight',
         feedBackBlurFaceMessage: 'Blur Detected Over Face',
         feedBackGlareFaceMessage: 'Glare Detected',
         // <!--// 0 for clean face and 100 for Blurry face or set it -1 to remove blur filter-->
         setBlurPercentage: 80,
         // <!--// Set min percentage for glare or set it -1 to remove glare filter-->
         setGlarePercentage_0: -1,
         // <!--// Set max percentage for glare or set it -1 to remove glare filter-->
         setGlarePercentage_1: -1,
         liveness_url: '<your liveness url>',
         contentType: 'form_data',
         feedBackLowLightMessage: 'Low light detected',
     };
     accura.startLiveness(accuraConfs, config, function (result) {
           //Result from the SDK
     }, function (error) {
          alert(error);
     });
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.accurascan.com/language/cordova/functions/facematch-and-liveness.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
