npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@id3/kyc

v2.1.0

Published

This component offers the following features: - Live capture or from gallery import of Columbian identity documents thanks to Blink ID in browser SDK. - Liveness detection from a camera thanks to id3 Face PAD web component. - A face match process between

Downloads

9

Readme

Id3 KYC - Angular web component

This component offers the following features:

  • Live capture or from gallery import of Columbian identity documents thanks to Blink ID in browser SDK.
  • Liveness detection from a camera thanks to id3 Face PAD web component.
  • A face match process between the ID card photo and the photo captured during liveness detection.
  • Display of ID card information.

You can find a live demo here

Table of content

Integration instructions

Authentication requirements

An API key, an API url and a Blink ID license key are required to use this web component.

Web component authentication

The authentication process shall be performed from the application backend to avoid making the API key in website source code.

The authentication process consists in the following steps:

  1. The front-end application calls the application back-end for a temporary authentication token.
  2. Call to API /authenticate from the back-end with the API Key
     POST Request
     Url : api_url/authenticate
     Body (json): { "key" : "$your_api_key_to_insert_here" }
     Response (json) : { "bearerToken" : "the_generated_token_to_give_to_the_web_component" }
  3. The application backend transmit the bearer token to the application front-end.
  4. Set the Bearer Token to the attribute authorization of the web component.

Installation

npm i @id3/kyc --save

Usage

The web component can be imported into an Angular application using the following code instruction:

import { Id3KycModule } from '@id3/kyc';

Then, the Id3KycModule has to be imported in the app.module.ts file:

...
imports: [
    ...,
    Id3KycModule,
    ...
],
...

Assets

The Kyc component uses images and Microblink SDK contained in its assets folder. So, glob patterns have to be included in the assets section of the build section of the angular.json file:

...
"assets": [
    {
        "glob": "**/*",
        "input": "node_modules/@id3/kyc/assets/",
        "output": "/assets/"
    },
    {
        "glob": "**/*",
        "input": "node_modules/@microblink/blinkid-in-browser-sdk/resources/",
        "output": "/assets/lib/"
    }
    ...
],
...

Apply styles

The component uses bootstrap for theming, so that bootstrap css and js and jquery js have to be included in the style and script sections of the build section of the angular.json file:

... 
"styles": [
    "node_modules/bootstrap/dist/css/bootstrap.min.css",
    ...
],
"scripts": [
    "node_modules/jquery/dist/jquery.min.js",
    "node_modules/bootstrap/dist/js/bootstrap.min.js",
    ...
]
...
Minimal example

The Id3 KYC web component hasto be added into an html page or a template file:

<id3-kyc 
    [authorization]="$apiKey"
    [apiUrl]="$apiEndpoint"
    [language]="$language"
    [blinkIdLicenseKey]="$blinkIdLicenseKey"
></id3-kyc>

Properties

| Name | Type | Default | Description | | ----------------- | --------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | authorization | string | default | Bearer token returned by the authentication process | | apiUrl | string | default | Base URL of the API | | language | LanguageSupportedType | | Set the language manually (LanguageSupportedType = 'en' | 'fr' | 'es'). If the parameter is not filled in and the browser language is not supported, spanish is used. | | blinkIdLicenseKey | string | | Blink ID license key |

Events

| Name | Parameters | Description | | ------------------ | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | | startEvent | | Callback invoked when the process is started. | | endEvent | Document information and match decision | Callback invoked when the process is done. | | cancelEvent | | Callback invoked on cancel button click. | | authTimeOutHandler | | Callback invoked on secured session invalid. Authorization token has to be renewed by authenticating to the API. |

Exemple of information returned by endEvent:

{
    biographics: {
        NUIP: "__",
        lastNames: "__",
        firstNames: "__",
        particle: "__",
        sex: "__"
    },
    faceMatch: boolean
}