4.15.0 • Published 2 years ago

ng-fad-facetec v4.15.0

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Getting started

Installation

npm install ng-fad-facetec

Dependencies

Add the folder provided by the technical team within the project assets (third-party/facetec)

DeviceKeyIdentifier, BaseURL, PublicFaceScanEncryptionKey, ProductionKeyText, etc.

Import

In the file necessary example.module.ts import the module.

In this case app.module.ts

import { NgFadFacetecModule } from 'ng-fad-facetec';
.
.
.
... imports: [
       ...,
       BrowserAnimationsModule 
       NgFadFacetecModule
    ]...

Usage

HTML

Add the selector inside some component and configure the output events:

<ng-fad-facetec
  [credentials]="credentials"
  (onerror)="onerror($event)"
  (oncomplete)="oncomplete($event)">
</ng-fad-facetec>

Typescript

Listen to the events:

.
.
.
export interface Credentials {
    deviceKeyIdentifier:string;
    baseURL:string;
    publicFaceScanEncryptionKey:string;
    productionKeyText: ProductionKeyText;
}

export interface ProductionKeyText {
    domains:string;
    expiryDate: string;
    key:string;
}

export enum ErrorFacetec {
  SESSION_COMPLETED_SUCCESSFULLY = 0,
  MISSING_GUIDANCE_IMAGES = 1,
  TIMEOUT = 2,
  CONTEXT_SWITCH = 3,
  PROGRAMMATICALLY_CANCELLED = 4,
  ORIENTATION_CHANGE_DURING_SESSION = 5,
  LANDSCAPE_MODE_NOT_ALLOWED = 6,
  USER_CANCELLED = 7,
  USER_CANCELLED_FROM_NEW_USER_GUIDANCE = 8,
  USER_CANCELLED_FROM_RETRY_GUIDANCE = 9,
  USER_CANCELLED_WHEN_ATTEMPTING_TO_GET_CAMERA_PERMISSIONS_ = 10,
  LOCKED_OUT = 11,
  CAMERA_NOT_ENABLED = 12,
  NON_PRODUCTION_MODE_DEVICE_KEY_IDENTIFIER_INVALID = 13,
  DOCUMENT_NOT_READY = 14,
  SESSION_IN_PROGRESS = 15,
  CAMERA_NOT_RUNNING = 16,
  INITIALIZATION_NOT_COMPLETED = 17,
  UNKNOWN_INTERNAL_ERROR = 18,
  USER_CANCELLED_VIA_CLICKABLE_READY_SCREEN_SUBTEXT = 19,
  NOT_ALLOWED_USE_IFRAME_CONSTRUCTOR = 20,
  NOT_ALLOWED_USE_NON_IFRAME_CONSTRUCTOR = 21,
  I_FRAME_NOT_ALLOWED_WITHOUT_PERMISSION = 22,
  STILL_LOADING_RESOURCES = 23,
  RESOURCES_COULD_NOT_BE_LOADED_ON_LAST_INIT = 24
}

export interface ResponseFacetec {
  faceScan: string | null;
  auditTrail: string[];
  lowQualityAuditTrail: string[];
  sessionId: string | null;
  status: number;
}
.
.
.
.

oncomplete(respose: ResponseFacetec ) {
  console.log(result); // all result from facetec
  alert(result.auditTrail[0]); // face image
}

onerror(error: ErrorFacetec) {
   alert(JSON.stringify(error));
}

Inputs

NameRequiredDefaultTypeDescription
credentialstruenullCredentialsCredentials required for facetec to work

Outputs

NameReturnDescription
oncompleteResponseFacetecFires when the liveness ends successfully
onerrorErrorFacetecIs called when an error happens
4.15.0

2 years ago

4.13.0

2 years ago

4.14.0

2 years ago

4.11.0

2 years ago

4.9.0

2 years ago

4.8.0

2 years ago

3.1.0

2 years ago

4.5.0

2 years ago

4.4.0

2 years ago

4.7.0

2 years ago

4.6.0

2 years ago

4.1.0

2 years ago

4.0.0

2 years ago

4.3.0

2 years ago

4.2.0

2 years ago

4.10.0

2 years ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago