Socket
Socket
Sign inDemoInstall

cordova-plugin-onyx

Package Overview
Dependencies
0
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cordova-plugin-onyx

Cordova plugin to use ONYX


Version published
Weekly downloads
30
increased by15.38%
Maintainers
2
Install size
110 kB
Created
Weekly downloads
 

Readme

Source

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.

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. 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@5.0.0

Additonal steps for iOS

Run the app for a device to build the app. From your meteor project directory

meteor run ios-device

Install the CocoaPod dependencies Open a terminal and navigate to the folder containing the project that was just created. From your meteor project directory

cd .meteor/local/cordova-build/platforms/ios/

pod install

Then open the project .xcworkspace file to run the app on an iOS device from XCode.

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

onyx.exec(options, successCallback, errorCallback)

Executes onyx with the specified options.

Supported Platforms

  • Android
  • iOS

Kind: static method of [onyx](#module_onyx)

ParamTypeDescription
options[OnyxOptions](#module_onyx.OnyxOptions)Parameters telling onyx what to execute.
successCallback[onSuccess](#module_onyx.onSuccess)
errorCallback[onError](#module_onyx.onError)

Example

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

onyx.onError : function

Callback function that provides an error message.

Kind: static typedef of [onyx](#module_onyx)

ParamTypeDescription
errorObjectAn error object containing an error code and message.

onyx.onSuccess : function

Callback function that provides the image data.

Kind: static typedef of [onyx](#module_onyx)

ParamTypeDescription
onyxResult[onyx](#module_onyx.OnyxResult)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;    
    }
}

Onyx

Onyx.OnyxOptions : JSON Object

Optional parameters to customize onyx configuration.

Kind: static typedef of [onyx](#module_onyx)
Properties

NameTypeDefaultPlatformDescription
onyxLicensestringxxxx-xxxx-xxxx-x-xBothRequired
Your license key for Onyx.
action[Action](#module_Onyx.ACTION)undefinedBothRequired
Choose the action for onyx to execute.
returnRawImagebooleanfalseBothIndicates if the raw fingerprint image will be returned.
returnGrayRawImagebooleanfalseiOSIndicates if the gray raw fingerprint image will be returned.
returnProcessedImagebooleanfalseBothIndicates if the processed fingerprint image will be returned.
returnEnhancedImagebooleanfalseBothIndicates if the enhanced fingerprint image will be returned.
returnBlackWhiteProcessedImagebooleanfalseiOSIndicates if the black and white processed fingerprint image will be returned.
returnFingerprintTemplatebooleanfalseBothIndicates if the base64 encoded fingerprint template will be returned.
returnWSQbooleanfalseBothIndicates if the base64 encoded WSQ fingerprint will be returned.
returnGrayRawWSQbooleanfalseiOSIndicates if the base64 encoded gray raw WSQ fingerprint will be returned.
shouldSegmentbooleanfalseAndroidIndicates if the fingerprint image should be segmented to remove background noise from the fingerprint image.
shouldConvertToISOTemplatebooleanfalseAndroidIndicates that the fingerprint template should be returned in ISO format.
imageRotationnumberIMAGE_ROTATION.NONEBothInteger value of 90 degrees (0, 90, 180, or 270) to rotate the fingerprint image output.
fingerDetectModenumberFINGER_DETECT_MODE.LIVE_FINGERBothInteger value of 0 or 1. Determines threshold level of finger coloration for autocapture.
wholeFingerCropbooleanfalseAndroidWill crop less of the image to return more of the fingerprint.
useManualCapturebooleanfalseBothDisables the auto-capture feature. User must tap the screen to trigger capture.
useOnyxLivebooleanfalseBothWill send the raw fingerprint image to the Onyx Liveness service to receive a liveness confidence score.
useFlashbooleantrueBothSets the flash to torch mode to illuminate the finger and help determine alignment with the reticle.
showLoadingSpinnerbooleanfalseBothShows a loading spinner while Onyx is doing asynchronous requests before the capture screen is presented.
reticleOrientationstringRETICLE_ORIENTATION.LEFTBothSets the direction of the finger reticle on the capture screen.
reticleAnglenumber0AndroidRequires LAYOUT_PREFERENCE.FULL
Integer value.
Adjusts the angle of the finger reticle.
reticleScalenumber1.0AndroidFloat value from 0 to 1.
Adjusts the scale of the finger reticle.
backgroundColorHexStringstring#3698D3BothHex color value for the background color of the bottom two-thirds of the capture screen.
showBackButtonbooleanfalseAndroidDisplays a back button on the capture screen.
backButtonTextstring"Back"BothSet text to use for back button (localization).
showManualCaptureTextbooleantrueBothShow or hide the manual capture text.
manualCaptureTextstring"Touch the screen to capture."BothSet custom text to use for manual capture (localization).
infoTextstringundefinedBothSet custom text to display on the capture screen.
infoTextColorHexStringstringundefinedBothSet the color of the text to display on the capture screen. Defaults to black or white depending on the tint of backgroundColorHexString
base64ImageDatastringundefinedBothBase64 encoded data string of image to display on the capture screen.
cropFactorfloat0.8BothAdjusts the zoom level of the fingerprint image. Higher numbers increase the zoom level.
cropSizeJSON Object

{
width: number,
height: number
}
width: 512
height: 300
BothSets the dimensions of the fingerprint image.
layoutPreferencestringLAYOUT_PREFERENCE.UPPER_THIRDBothSets the display of the camera view.
probestringundefinedBothRequired for Onyx.ACTION.MATCH
Base64 encoded WSQ data to match against a reference fingerprint template.
referencestringundefinedBothRequired for Onyx.ACTION.MATCH
Base64 encoded fingerprint template to match against a probe fingerprint template.
pyramidScalesArray<string>["0.8", "1.0", "1.2"]BothOptional for Onyx.ACTION.MATCH
Array of string representations of float values for image pyramiding during matching.

Example Interface

export interface IOnyxConfiguration {
  action?: string,
  onyxLicense?: string,
  returnRawImage?: boolean,
  returnGrayRawImage?: boolean,
  returnProcessedImage?: boolean,
  returnEnhancedImage?: boolean,
  returnBlackWhiteProcessedImage?: boolean,
  returnFingerprintTemplate?: boolean,
  returnWSQ?: boolean,
  returnGrayRawWSQ?: boolean,
  shouldSegment?: boolean,
  shouldConvertToISOTemplate?: boolean,
  imageRotation?: number,
  fingerDetectMode?: number,
  wholeFingerCrop?: boolean,
  useManualCapture?: boolean,
  useOnyxLive?: boolean,
  useFlash?: boolean,
  showLoadingSpinner?: boolean,
  reticleOrientation?: string,
  reticleAngle?: number,
  reticleScale?: number,
  backgroundColorHexString?: string,
  showBackButton?: boolean,
  showManualCaptureText?: boolean,
  manualCaptureText?: string,
  backButtonText?: string,
  infoText?: string,
  infoTextColorHexString?: string,
  base64ImageData?: string,
  cropFactor?: number,
  cropSize?: { width?: number, height?: number },
  layoutPreference?: string,
  probe?: string,
  reference?: string,
  pyramidScales?: Array<string>
}

Onyx.ACTION : Enum

Kind: static constants for actions of [Onyx](#module_Onyx)
Properties

NameTypeValueDescription
CAPTUREstring"capture"Launches the Onyx Camera to capture a fingerprint and return an [OnyxResult](#module_onyx.OnyxResult) object. Requires OnyxOptions.onyxLicense
MATCHstring"match"Performs on-device matching of the probe and reference fingerprint templates. Requires OnyxOptions.reference and OnyxOptions.probe

Onyx.RETICLE_ORIENTATION : Enum

Kind: static constants for reticleOrientation of [OnyxOptions](#module_Onyx.OnyxOptions)
Properties

NameTypeValueDescription
LEFTstring"LEFT"default
Finger reticle on the capture screen will be oriented for a left hand capture.
RIGHTstring"RIGHT"Finger reticle on the capture screen will be oriented for a right hand capture.

Onyx.LAYOUT_PREFERENCE : Enum

Kind: static constants for layoutPreference of [OnyxOptions](#module_Onyx.OnyxOptions)
Properties

NameTypeValueDescription
UPPER_THRIDstring"UPPER_THRID"The camera view will only occupy the top third of the capture screen.
FULLstring"FULL"The camera view will be full screen.

Onyx.IMAGE_ROTATION : Enum

Kind: static constants for imageRotation of [OnyxOptions](#module_Onyx.OnyxOptions)
Properties

NameTypeValueDescription
ROTATE_NONEnumber0Default Does not rotate the image.
ROTATE_90_COUNTER_CLOCKWISEnumber90Rotates the image 90 degrees counter clockwise.
ROTATE_180number180Rotates the image 180 degrees.
ROTATE_90_CLOCKWISEnumber270Rotates the image 90 degrees clockwise (270 degrees counter clockwise).

Onyx.IMAGE_ROTATION : Enum

Kind: static constants for fingerDetectMode of [OnyxOptions](#module_Onyx.OnyxOptions)
Properties

NameTypeValueDescription
DEAD_FINGERnumber0Color threshold for dead fingers.
LIVE_FINGERnumber1default
Color threshold for live fingers.

Onyx.OnyxResult : JSON Object

Results return by Onyx.

Kind: Return type of [onyx.onSuccess](#module_onyx.onSuccess)
Properties

NameTypeDescription
actionstringThe Onyx.ACTION that was specified in the OnyxOptions
rawFingerprintDataUristringDataUri prefixed, base64 encoded string representation of the raw fingerprint image.
grayRawFingerprintDataUristringDataUri prefixed, base64 encoded string representation of the gray raw fingerprint image.
processedFingerprintDataUristringDataUri prefixed, base64 encoded string representation of the processed fingerprint image.
enhancedFingerprintDataUristringDataUri prefixed, base64 encoded string representation of the enhanced fingerprint image.
blackWhiteProcessedFingerprintDataUristringDataUri prefixed, base64 encoded string representation of the black and white processed fingerprint image.
base64EncodedWsqBytesstringBase64 encoded bytes of the WSQ fingerprint image.
base64EncodedGrayRawWsqBytesstringBase64 encoded bytes of the gray raw WSQ fingerprint image.
base64EncodedFingerprintTemplatestringBase64 encoded bytes of the fingerprint template.
captureMetrics[Onyx.CaptureMetrics](#module_Onyx.CaptureMetrics)JSON Object containing the capture metrics.
isVerifiedbooleanIndicates if the proble fingerprint template matched the reference fingerprint template
matchScorenumberMatch score of the compared probe and reference fingerprint templates.

Example Interface

export interface IOnyxResult {
    action?: string,
    rawFingerprintDataUri?: string,
    grayRawFingerprintDataUri?: string,
    processedFingerprintDataUri?: string,
    enhancedFingerprintDataUri?: string,
    blackWhiteProcessedFingerprintDataUri?: string,
    base64EncodedFingerprintTemplate?: string,
    base64EncodedWsqBytes?: string,
    base64EncodedGrayRawWsqBytes?: string,
    captureMetrics?: {
        nfiqMetrics?: {
            nfiqScore?: number,
            mlpScore?: number
        },
        livenessConfidence?: number,
        focusQuality?: number,
        distanceToCenter?: number,
        fillProperties?: {
            heightRatio?: number,
            overlapRatio?: number
        }
    },
    isVerified?: boolean,
    matchScore?: number
}

Onyx.CaptureMetrics : JSON Object

Kind: static typedef for [Onyx](#module_Onyx)
Properties

NameTypeDescription
nfiqMetrics[Onyx.NfiqMetrics](#module_Onyx.NfiqMetrics)JSON Object containing the NFIQ Metrics of nfiqScore and mlpScore.
livenessConfidencenumberFloat value 0 - 1 indicating the percent confidence that the image captured was a real live fingerprint. Greater than 0.5 (50%) would suggest the finger was more real than fake. Less than 0.5 (50%) would suggest the finger was more fake than real.
focusQualitynumber
distanceToCenternumber
fillProperties[Onyx.FillProperties](#module_Onyx.FillProperties)Android only
JSON Object containg the fill properties of heightRatio and overlapRatio.

Onyx.NfiqMetrics : JSON Object

Kind: static typedef for [Onyx](#module_Onyx)
Properties

NameTypeDescription
nfiqScorenumberNIST Fingerprint Image Quality. Integer value 1 - 5. A value of 5 being the lowest quality fingerprint image and should not be used for matching or saved as a biometric enrollment.
mlpScorenumberMulti-Layer Perceptrons (MLP) Score is a float value from 0 - 1 describing the percent certainty of the NFIQ Score.

Onyx.FillProperties : JSON Object

Kind: static typedef for [Onyx](#module_Onyx)
Properties

NameTypeDescription
heightRationumber
overlapRationumber

Keywords

FAQs

Last updated on 11 Apr 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc