<commit_before>### This is not free software.  This plugin uses the Onyx sofware development kits (SDKs) for Android and iOS.  It requires a license agreement with: 
[Diamond Fortress Technologies, Inc.](http://www.diamondfortress.com)

# cordova-plugin-onyx

This plugin defines a global `navigator.onyx` object, which provides an API for capturing a fingerprint image, for in-app fingerprint enrollment and verification, and for fingerprint template generation for server side fingerprint authentication.

Although the object is attached to the global scoped `navigator`, it is not available until after the `deviceready` event.

    document.addEventListener("deviceready", onDeviceReady, false);
    function onDeviceReady() {
        console.log(navigator.onyx);
    }


## Installation
Contact [Diamond Fortress Technologies, Inc.](http://www.diamondfortress.com) and sign a license agreement to obtain a license key.

This requires cordova 5.0+

```
    cordova plugin add cordova-plugin-onyx
```
```
    meteor add cordova:cordova-plugin-onyx
```

## Quick Use Example
####MeteorJS applications
Create a settings.json file to load at runtime.

```
{
    "public": {
        "onyxLicense": "xxxx-xxxx-xxxx-x-x"
    }
}
```

Reference the Onyx license when you execute an Onyx action.

```
var onyxOptions = {
    onyxLicense = Meteor.settings.public.onyxLicense;
    action = Onyx.ACTION.CAPTURE;
}
navigator.onyx.exec(onyxOptions, onyxSuccessCallback, onyxErrorCallback);
```

Run the application on a mobile device

```
meteor run android-device --settings settings.json
```


# API Reference


* [onyx](#module_onyx)
    * [.exec(options, successCallback, errorCallback)](#module_onyx.exec)
    * [.onError](#module_onyx.onError) : <code>function</code>
    * [.onSuccess](#module_onyx.onSuccess) : <code>function</code>
    * [.OnyxOptions](#module_onyx.OnyxOptions) : <code>Object</code>


* [Onyx](#module_Onyx)
    * [.Action](#module_Onyx.ACTION) : <code>enum</code>

---

<a name="module_onyx"></a>
## onyx
<a name="module_onyx.exec"></a>
### onyx.exec(options, successCallback, errorCallback)
Executes onyx with the specified options.

__Supported Platforms__

- Android
- iOS

**Kind**: static method of <code>[onyx](#module_onyx)</code>  

| Param | Type | Description |
| --- | --- | --- |
| options | <code>[OnyxOptions](#module_onyx.OnyxOptions)</code> | Parameters telling onyx what to execute. |
| successCallback | <code>[onSuccess](#module_onyx.onSuccess)</code> |  |
| errorCallback | <code>[onError](#module_onyx.onError)</code> |  |

**Example**  

```
navigator.onyx.exec(onyxOptions, onyxSuccess, onyxError);
```

<a name="module_onyx.onError"></a>
### onyx.onError : <code>function</code>
Callback function that provides an error message.

**Kind**: static typedef of <code>[onyx](#module_onyx)</code>  

| Param | Type | Description |
| --- | --- | --- |
| error | <code>Object</code> | An error object containing an error code and message. |

<a name="module_onyx.onSuccess"></a>
### onyx.onSuccess : <code>function</code>
Callback function that provides the image data.

**Kind**: static typedef of <code>[onyx](#module_onyx)</code>  

| Param | Type | Description |
| --- | --- | --- |
| onyxResult | <code>[onyx](#module_onyx.OnyxResult)</code> | Object containing the results of the executed action. |

**Example**  

```
// Display an image of the processed fingerprint
function onyxSuccess(onyxResult) {
    if (onyxResult.action === Onyx.ACTION.CAPTURE) {
        var image = document.getElementById('myImage');
           image.src = onyxResult.processedFingerprintDataUri;    
    }
}
```

<a name="module_Onyx"></a>
## Onyx

<a name="module_Onyx.OnyxOptions"></a>
### Onyx.OnyxOptions : <code>Object</code>
Optional parameters to customize onyx configuration.

**Kind**: static typedef of <code>[onyx](#module_onyx)</code>  
**Properties**

| Name | Type | Default | Platform | Description |
| --- | --- | --- | --- | --- |
| onyxLicense | <code>string</code> | <code>xxxx-xxxx-xxxx-x-x</code> | Both |  **Required**<br> Your license key for Onyx. |
| action | <code>[Action](#module_Onyx.ACTION)</code> | undefined | Both | **Required**<br> Choose the action for onyx to execute. |
| returnRawImage | <code>boolean</code> | <code>false</code> | Both | Indicates if the raw fingerprint image will be returned. | 
| returnGrayRawImage | <code>boolean</code> | <code>false</code> | iOS | Indicates if the gray raw fingerprint image will be returned.| 
| returnProcessedImage | <code>boolean</code> | <code>false</code> | Both | Indicates if the processed fingerprint image will be returned. | 
| returnEnhancedImage | <code>boolean</code> | <code>false</code> | Both | Indicates if the enhanced fingerprint image will be returned. | 
| returnBlackWhiteProcessedImage | <code>boolean</code> | <code>false</code> | iOS | Indicates if the black and white processed fingerprint image will be returned. | 
| returnFingerprintTemplate | <code>boolean</code> | <code>false</code> | Both | Indicates if the base64 encoded fingerprint template will be returned. | 
| returnWSQ | <code>boolean</code> | <code>false</code> | Both | Indicates if the base64 encoded WSQ fingerprint will be returned. | 
| returnGrayRawWSQ | <code>boolean</code> | <code>false</code> | iOS | Indicates if the base64 encoded gray raw WSQ fingerprint will be returned. |
| shouldSegment | <code>boolean</code> | <code>false</code> | Android | Indicates if the fingerprint image should be segmented to remove background noise from the fingerprint image.| 
| shouldConvertToISOTemplate | <code>boolean</code> | <code>false</code> | Android | Indicates that the fingerprint template should be returned in ISO format.|
| imageRotation | <code>number</code> | 0 | Android | Integer value of 90 degrees (0, 90, 180, or 270). |
| wholeFingerCrop | <code>boolean</code> | <code>false</code> | Android | Will crop less of the image to return more of the fingerprint. | 
| useManualCapture | <code>boolean</code> | <code>false</code> | Android | Disables the auto-capture feature.  User must tap the screen to trigger capture.| 
| useOnyxLive | <code>boolean</code> | <code>false</code> | Both | Will send the raw fingerprint image to the Onyx Liveness service to receive a liveness confidence score.| 
| useFlash | <code>boolean</code> | <code>true</code> | Both | Sets the flash to torch mode to illuminate the finger and help determine alignment with the reticle.  | 
| showLoadingSpinner | <code>boolean</code> | <code>false</code> | Both | Shows a loading spinner while Onyx is doing asynchronous requests before the capture screen is presented.| 
| shouldInvert | <code>boolean</code> | <code>true</code> | iOS | Inverts the colors (bitwise) of the processed fingerprint images to make the valleys and ridges the same color as a touch based sensor. | 
| reticleOrientation | <code>string</code> | <code>[RETICLE_ORIENTATION.LEFT](#module_Onyx.RETICLE_ORIENTATION)</code> | Both | Sets the direction of the finger reticle on the capture screen. |
| reticleAngle | <code>number</code> | 0 | Android | Requires [LAYOUT_PREFERENCE.FULL](#module_Onyx.LAYOUT_PREFERENCE)<br>Integer value.<br>Adjusts the angle of the finger reticle. |
| reticleScale | <code>number</code> | 1.0 | Android | Float value from 0 to 1.<br>Adjusts the scale of the finger reticle. |
| backgroundColorHexString | <code>string</code> | "#3698D3" | Both | Hex color value for the background color of the bottom two-thirds of the capture screen.|
| showBackButton | <code>boolean</code> | <code>false</code> | Android | Displays a back button on the capture screen.| 
| cropFactor | <code>float</code> | <strong>Android</strong> 0.8<br><strong>iOS</strong> 0.9| Both | Float value from 0 to 1.<br> Adjusts the crop factor for the fingerprint image.|
| cropSize | <code>JSON Object</code><br><br>{<br>width: <code>number</code>,<br> height: <code>number</code><br>} | <strong>Android</strong><br>width: 512<br>height: 300<br><br><strong>iOS</strong><br>width: 600<br>height: 960 | Both | Sets the dimensions of the fingerprint image. |
| layoutPreference | <code>string</code> | <code>[LAYOUT_PREFERENCE.UPPER_THIRD](#module_Onyx.LAYOUT_PREFERENCE)</code> | Both | Sets the display of the camera view.|
| flip | <code>string</code> | <code>[FLIP.HORIZONTAL](#module_Onyx.FLIP)</code> | Both | Flips the orientation of the fingerprint image. |<commit_msg>formatting<commit_after>### This is not free software.  This plugin uses the Onyx sofware development kits (SDKs) for Android and iOS.  It requires a license agreement with: 
[Diamond Fortress Technologies, Inc.](http://www.diamondfortress.com)

# cordova-plugin-onyx

This plugin defines a global `navigator.onyx` object, which provides an API for capturing a fingerprint image, for in-app fingerprint enrollment and verification, and for fingerprint template generation for server side fingerprint authentication.

Although the object is attached to the global scoped `navigator`, it is not available until after the `deviceready` event.

    document.addEventListener("deviceready", onDeviceReady, false);
    function onDeviceReady() {
        console.log(navigator.onyx);
    }


## Installation
Contact [Diamond Fortress Technologies, Inc.](http://www.diamondfortress.com) and sign a license agreement to obtain a license key.

This requires cordova 5.0+

```
    cordova plugin add cordova-plugin-onyx
```
```
    meteor add cordova:cordova-plugin-onyx
```

## Quick Use Example
####MeteorJS applications
Create a settings.json file to load at runtime.

```
{
    "public": {
        "onyxLicense": "xxxx-xxxx-xxxx-x-x"
    }
}
```

Reference the Onyx license when you execute an Onyx action.

```
var onyxOptions = {
    onyxLicense = Meteor.settings.public.onyxLicense;
    action = Onyx.ACTION.CAPTURE;
}
navigator.onyx.exec(onyxOptions, onyxSuccessCallback, onyxErrorCallback);
```

Run the application on a mobile device

```
meteor run android-device --settings settings.json
```


# API Reference


* [onyx](#module_onyx)
    * [.exec(options, successCallback, errorCallback)](#module_onyx.exec)
    * [.onError](#module_onyx.onError) : <code>function</code>
    * [.onSuccess](#module_onyx.onSuccess) : <code>function</code>
    * [.OnyxOptions](#module_onyx.OnyxOptions) : <code>Object</code>


* [Onyx](#module_Onyx)
    * [.Action](#module_Onyx.ACTION) : <code>enum</code>

---

<a name="module_onyx"></a>
## onyx
<a name="module_onyx.exec"></a>
### onyx.exec(options, successCallback, errorCallback)
Executes onyx with the specified options.

__Supported Platforms__

- Android
- iOS

**Kind**: static method of <code>[onyx](#module_onyx)</code>  

| Param | Type | Description |
| --- | --- | --- |
| options | <code>[OnyxOptions](#module_onyx.OnyxOptions)</code> | Parameters telling onyx what to execute. |
| successCallback | <code>[onSuccess](#module_onyx.onSuccess)</code> |  |
| errorCallback | <code>[onError](#module_onyx.onError)</code> |  |

**Example**  

```
navigator.onyx.exec(onyxOptions, onyxSuccess, onyxError);
```

<a name="module_onyx.onError"></a>
### onyx.onError : <code>function</code>
Callback function that provides an error message.

**Kind**: static typedef of <code>[onyx](#module_onyx)</code>  

| Param | Type | Description |
| --- | --- | --- |
| error | <code>Object</code> | An error object containing an error code and message. |

<a name="module_onyx.onSuccess"></a>
### onyx.onSuccess : <code>function</code>
Callback function that provides the image data.

**Kind**: static typedef of <code>[onyx](#module_onyx)</code>  

| Param | Type | Description |
| --- | --- | --- |
| onyxResult | <code>[onyx](#module_onyx.OnyxResult)</code> | Object containing the results of the executed action. |

**Example**  

```
// Display an image of the processed fingerprint
function onyxSuccess(onyxResult) {
    if (onyxResult.action === Onyx.ACTION.CAPTURE) {
        var image = document.getElementById('myImage');
           image.src = onyxResult.processedFingerprintDataUri;    
    }
}
```

<a name="module_Onyx"></a>
## Onyx

<a name="module_Onyx.OnyxOptions"></a>
### Onyx.OnyxOptions : <code>Object</code>
Optional parameters to customize onyx configuration.

**Kind**: static typedef of <code>[onyx](#module_onyx)</code>  
**Properties**

| Name | Type | Default | Platform | Description |
| --- | --- | --- | --- | --- |
| onyxLicense | <code>string</code> | <code>xxxx-xxxx-xxxx-x-x</code> | Both |  **Required**<br> Your license key for Onyx. |
| action | <code>[Action](#module_Onyx.ACTION)</code> | <code>undefined</code> | Both | **Required**<br> Choose the action for onyx to execute. |
| returnRawImage | <code>boolean</code> | <code>false</code> | Both | Indicates if the raw fingerprint image will be returned. | 
| returnGrayRawImage | <code>boolean</code> | <code>false</code> | iOS | Indicates if the gray raw fingerprint image will be returned.| 
| returnProcessedImage | <code>boolean</code> | <code>false</code> | Both | Indicates if the processed fingerprint image will be returned. | 
| returnEnhancedImage | <code>boolean</code> | <code>false</code> | Both | Indicates if the enhanced fingerprint image will be returned. | 
| returnBlackWhiteProcessedImage | <code>boolean</code> | <code>false</code> | iOS | Indicates if the black and white processed fingerprint image will be returned. | 
| returnFingerprintTemplate | <code>boolean</code> | <code>false</code> | Both | Indicates if the base64 encoded fingerprint template will be returned. | 
| returnWSQ | <code>boolean</code> | <code>false</code> | Both | Indicates if the base64 encoded WSQ fingerprint will be returned. | 
| returnGrayRawWSQ | <code>boolean</code> | <code>false</code> | iOS | Indicates if the base64 encoded gray raw WSQ fingerprint will be returned. |
| shouldSegment | <code>boolean</code> | <code>false</code> | Android | Indicates if the fingerprint image should be segmented to remove background noise from the fingerprint image.| 
| shouldConvertToISOTemplate | <code>boolean</code> | <code>false</code> | Android | Indicates that the fingerprint template should be returned in ISO format.|
| imageRotation | <code>number</code> | `0` | Android | Integer value of 90 degrees (0, 90, 180, or 270). |
| wholeFingerCrop | <code>boolean</code> | <code>false</code> | Android | Will crop less of the image to return more of the fingerprint. | 
| useManualCapture | <code>boolean</code> | <code>false</code> | Android | Disables the auto-capture feature.  User must tap the screen to trigger capture.| 
| useOnyxLive | <code>boolean</code> | <code>false</code> | Both | Will send the raw fingerprint image to the Onyx Liveness service to receive a liveness confidence score.| 
| useFlash | <code>boolean</code> | <code>true</code> | Both | Sets the flash to torch mode to illuminate the finger and help determine alignment with the reticle.  | 
| showLoadingSpinner | <code>boolean</code> | <code>false</code> | Both | Shows a loading spinner while Onyx is doing asynchronous requests before the capture screen is presented.| 
| shouldInvert | <code>boolean</code> | <code>true</code> | iOS | Inverts the colors (bitwise) of the processed fingerprint images to make the valleys and ridges the same color as a touch based sensor. | 
| reticleOrientation | <code>string</code> | <code>[RETICLE_ORIENTATION.LEFT](#module_Onyx.RETICLE_ORIENTATION)</code> | Both | Sets the direction of the finger reticle on the capture screen. |
| reticleAngle | <code>number</code> | `0` | Android | Requires [LAYOUT_PREFERENCE.FULL](#module_Onyx.LAYOUT_PREFERENCE)<br>Integer value.<br>Adjusts the angle of the finger reticle. |
| reticleScale | <code>number</code> | `1.0` | Android | Float value from 0 to 1.<br>Adjusts the scale of the finger reticle. |
| backgroundColorHexString | <code>string</code> | `#3698D3` | Both | Hex color value for the background color of the bottom two-thirds of the capture screen.|
| showBackButton | <code>boolean</code> | <code>false</code> | Android | Displays a back button on the capture screen.| 
| cropFactor | <code>float</code> | <strong>Android</strong> `0.8`<br><strong>iOS</strong> `0.9`| Both | Float value from 0 to 1.<br> Adjusts the crop factor for the fingerprint image.|
| cropSize | <code>JSON Object</code><br><br>{<br>width: <code>number</code>,<br> height: <code>number</code><br>} | <strong>Android</strong><br>width: `512`<br>height: `300`<br><br><strong>iOS</strong><br>width: `600`<br>height: `960` | Both | Sets the dimensions of the fingerprint image. |
| layoutPreference | <code>string</code> | <code>[LAYOUT_PREFERENCE.UPPER_THIRD](#module_Onyx.LAYOUT_PREFERENCE)</code> | Both | Sets the display of the camera view.|
| flip | <code>string</code> | <code>[FLIP.HORIZONTAL](#module_Onyx.FLIP)</code> | Both | Flips the orientation of the fingerprint image. |
{'fraction_non_alphanumeric': 0.1421208530805687, 'fraction_numerical': 0.005687203791469194, 'mean_word_length': 4.691503708698584, 'pattern_counts': {'":': 4, '<': 349, '<?xml version=': 0, '>': 349, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2291558', 'n_tokens_mistral': 5478, 'n_tokens_neox': 5063, 'n_words': 1520}