5.10.1 • Published 2 years ago
ng-fad-acuant v5.10.1
Getting started
Installation
npm install ng-fad-acuant
Dependencies
Add the folder provided by the technical team within the project assets (third-party/acuant)
Import
In the file necessary example.module.ts import the module.
In this case app.module.ts
import { NgFadAcuantModule } from 'ng-fad-acuant';
.
.
.
... imports: [
...,
BrowserAnimationsModule
NgFadAcuantModule
]...
Usage
HTML
Add the selector inside some component and configure the output events:
<ng-fad-acuant
[credentials]="credentials"
[configuration]= "configuration"
[side]=0
[idData]=false
[idPhoto]=false
[imageQuality]= 1
(onerror)="onerror($event)"
(oncomplete)="oncomplete($event)">
</ng-fad-acuant>
Typescript
Listen to the events:
.
.
.
export interface AcuantCredentials {
passiveUsername: string;
passivePassword: string;
passiveSubscriptionId: string;
acasEndpoint: string;
livenessEndpoint: string;
}
export interface AcuantResultImage {
image: {
data: string;
width: number;
height: number;
};
glare: string;
dpi: string;
cardType: string;
sharpness: string;
moire: string;
moireraw: string;
}
export class AcuantResultIdData {
ocr: AcuantOcr;
validation: AcuantValidation;
}
export interface AcuantResult {
id: AcuantResultImage;
idData?: AcuantResultIdData;
idPhoto?: string;
}
export enum ErrorAcuant {
REQUIRED_CREDENTIALS= -1,
FAIL_INITIALIZATION= -2,
UNSUPPORTED_CAMERA = -3,
FAIL_INITIALIZATION_CAMERA_UI= -4,
FAIL_CREATION_INSTANCE_DOCUMENT= -5,
FAIL_UPLOAD_IMAGE= -6,
FAIL_GET_OCR= -7,
FAIL_GET_FACE_IMAGE= -8
}
.
.
.
.
readonly credentials = {
passiveUsername: 'XXXXXXXX';
passivePassword: 'XXXXXXXX';
passiveSubscriptionId: 'XXXXXXXX';
acasEndpoint: 'XXXXXXXX';
livenessEndpoint: 'XXXXXXXX';
assureidEndpoint: 'XXXXXXXX';
}
public configuration = {
customization: {
moduleCustomization: {
legends: {
initializing: 'iniciando',
processing: 'procesando',
scan: {
none: 'ENFOCA TU ID SOBRE LA GUÍA',
smallDocument: 'ACERCATE MÁS',
goodDocument: null,
capturing: 'CAPTURANDO',
tapToCapture: 'TOCA LA PANTALLA PARA CAPTURAR'
},
manualCapture: {
instruction: 'Captura el frente de tu identificación',
buttonNext: 'Continuar'
}
},
},
},
}
.
.
.
oncomplete(result: AcuantResult) {
console.log(result)
}
onerror(error: ErrorAcuant) {
alert(JSON.stringify(error));
}
Inputs
Name | Required | Default | Type | Description |
---|---|---|---|---|
credentials | true | null | AcuantCredentials | Credentials required for acuant to work |
configuration | false | object | object | configuration of legends |
side | false | 0 | number (0 or 1) | Side of image to capture, 0 - Front, 1 - Back |
idData | false | false | boolean | add OCR and OCR validation to the final response |
idPhoto | false | false | boolean | Image of the face cutout, only works if idData is true |
imageQuality | false | 1 | number (0.1 to 1) | Quality of the image result |
Outputs
Name | Return | Description |
---|---|---|
oncomplete | string | Fires when the liveness ends successfully |
onerror | object | Is called when an error happens |
5.10.1
2 years ago
5.9.1
2 years ago
5.8.1
2 years ago
5.7.1
2 years ago
5.7.0
2 years ago
5.6.0
2 years ago
5.5.0
2 years ago
5.4.0
2 years ago
5.3.0
2 years ago
5.2.0
2 years ago
5.1.0
2 years ago
5.0.0
2 years ago
4.2.0
2 years ago
3.0.6
2 years ago
4.1.0
2 years ago
4.0.0
2 years ago
3.0.4
2 years ago
3.0.3
2 years ago
3.0.2
2 years ago
3.0.5
2 years ago
3.0.1
3 years ago
3.0.0
3 years ago
2.0.1
3 years ago
2.0.0
3 years ago
1.1.10
3 years ago
1.1.9
3 years ago
1.0.9
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