1.4.8 • Published 4 years ago

eid-commons v1.4.8

Weekly downloads
6
License
ISC
Repository
-
Last release
4 years ago

EID commons

WE SUGGEST THE USAGE OF TYPESCRIPT TO USE OUR TYPE DEFINITIONS AND EXTENDED DOCUMENTATION

For a practical demonstration of this library please check our web showcase out, with your sandbox API TOKEN.

Getting started

To start using eid-commons, you'll need to install it via npm (npm i eid-commons -S) once it has finished installing, you'll need to write to following code to inject our SDK scripts: ^1

^1 this is no longer necessary since our api scripts take in an optional einvironment parameter, but we do recommend this approach since it takes less time.

  import { sandbox } from 'eid-commons/conf/endpoints';
  import eid from 'eid-commons';
  eid.initEID(sandbox);

This code will inject all of our sdk scripts in the <head> of your document. If you only require from a single of our sdks, you can load only the necessary ones via:

  import { apis, live } from 'eid-commons/conf/endpoints';
  import eid from 'eid-commons';
  eid.setEnv(live);
  eid.initEIDEndpoint(apis.videoID);

if evertthing went fine You'll now require to get your one time authorization from your database if you don't have a token and want to use our technologies, please request one. ^2

^2 this token is set globally to be saved on a safe back-end, not in the front-end visit our website to request one.

Our apis

A step by step guide to using all of our apis

- VideoId

to begin using videoId you'll need to write the following import:

import VideoID from 'eid-commons/api/videoID';

this will yield an object with the following structure: ^3

^3 all of thhe inner fields are exported as independent functions, instead of belonging to a class, and they can be imported individually from their respective routes import VideoID from 'eid-commons/dist/lib/api/videoID/'.

const videoID = {
  substantial,
  medium,
};
  • VideoID substantial:

Your go-to unattended video identification, it requires a token but not a registration authority to be performed.

HTML:

<div id="video" style="width: 100vw; height: 100vh;"></div>
<!-- please remember to set your width and height>

JS/TS:

import VideoID from 'eid-commons/api/videoID';
  VideoID.substantial(
    'video',
    MY_AUTH,
    {
      lang: 'en',
      idType: 62, //<------- spanish nif number
      destroy: true //<------ optional, true by default
    }
    ).then((res) => {
    const video = res.response;
    const videoId = res.element;
    /* your response code here */
    });
  }),
    (err) => {
      const videoId = err.element;
      /* your error code here */
    };

VideoID.substantial takes in the id of the tag to be used as the video container, your auth, and two optional parameters, one to specify thelanguage, identity document type, and if the videoID element is to be destroyed automtically or not, if it is undefined will be returned instead of the element.

  • VideoID medium:

Your (simpler) go-to unattended video identification, it has the same requirements as videoId substantial, but it will not perform face recognition.

HTML:

<div id="video" style="width: 100vw; height: 100vh;"></div>
<!-- please remember to set your width and height>

JS/TS:

import VideoID from 'eid-commons/api/videoID';
  VideoID.medium(
    'video',
    MY_AUTH,
    {
      lang: 'en',
      idType: 62, //<------- spanish nif number
      destroy: true //<------ optional, true by default
    }
    ).then((res) => {
    const video = res.response;
    const videoScan = res.element;
    /* your response code here */
    });
  }),
    (err) => {
      const videoScan = err.element;
      /* your error code here */
    };

VideoID.medium takes in the id of the tag to be used as the video container, your auth, and two optional parameters, one to specify the language, identity document type, and if the videoScan element is to be destroyed automtically or not, if it is, undefined will be returned instead of the element.

1.4.8

4 years ago

1.4.7

5 years ago

1.4.6

5 years ago

1.4.5

5 years ago

1.4.0

5 years ago

1.3.33

5 years ago

1.3.32

5 years ago

1.3.31

5 years ago

1.3.3

5 years ago

1.3.29

5 years ago

1.3.28

5 years ago

1.3.27

5 years ago

1.3.26

5 years ago

1.3.25

5 years ago

1.3.24

5 years ago

1.3.23

5 years ago

1.3.22

5 years ago

1.3.21

5 years ago

1.3.20

5 years ago

1.3.18

5 years ago

1.3.17

5 years ago

1.3.16

5 years ago

1.3.14

5 years ago

1.3.13

5 years ago

1.3.12

5 years ago

1.3.11

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.11

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.33

5 years ago

1.0.32

5 years ago

1.0.31

5 years ago

1.0.29

5 years ago

1.0.28

5 years ago

1.0.27

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago