3.0.7 • Published 2 years ago

@jackk5/clone-sdk-lib v3.0.7

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

SDK lib

This is source code of ekyc SDK project

Technology

  • Language Javascript

index.js

index.js is the main file. This file return 2 object.

  • CardLiveness - for cardliveness
    • init - Initialize model card
    • validate - get a video element as input and return a callback function as output
      • output contains
        • message (string): message get from model card
        • fileImage (File): image crop from video resize
        • fileImage2 (File): image crop from video
        • success (boolean): Valid card return true, invalid return false
        • code (number): corresponding code get from model card
  • FaceLiveness - for faceliveness
    • init - Initialize model face
    • renderPrediction - get a video element as input and output is 2 function handleMediapipeModelCallback and onFaceModelCallBack
      • onFaceDetectionCallBack is called each frame on video element
        • success (boolean): return true if have valid face and one face
        • message (string): corresponding message
      • onFaceModelCallBack is called each frame on video element
        • success (boolean): return true if have valid face and one face
        • message (string): corresponding message

Other file

  • constant.js: Include message get from model
  • first.js: Include the data to simulate the first run of model

Publish into github package

Step1: Login github account

Login Techainer admin github account in your local Run command

git config --global user.email "admin@techainer.com"

You also need Techainer admin github account access token Follow this link to get access token of admin@techainer.com github account NOTE: not your github account

Step2: Config github in local

Go to project's .git folder by run

cd FOLDER_NAME
cd .git

Open config file Replace url in [remote "origin"] with

url = https://Techainer-admin:TOKEN@github.com/Techainer/web-sdk-lib

TOKEN is the genarate token you get before

Step3: Make package.json file

Package.json must have these data, other information follow package.json's default

"name": "@Techainer/web-sdk-lib",
// VERSION is defined by coder
"version": VERSION,
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
"repository": {
    "type": "git",
    // URL is the HTTPS link of to clone this repo in github
    "url": "git+URL.git" 
  }
Step4: Login into npm in your local

Run command

npm login

Then enter your username, password, email to login into npm in local.

Step5: Publish into npm

Run command

npm publish

to publish your code.

Usage

Make .npmrc file like this. TOKEN get from lib owner's github

//npm.pkg.github.com/:_authToken=TOKEN
@techainer:registry=https://npm.pkg.github.com

Install npm package

yarn add @techainer/web-sdk-lib@version

or

npm install @techainer/web-sdk-lib@version

Import lib into Component

import{CardLiveness,FaceLiveness}from "@techainer/web-sdk-lib"

Now you can use.

1.0.19

2 years ago

1.0.2

2 years ago

1.0.18

2 years ago

1.0.1

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.9

2 years ago

2.0.8

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

2.0.1

2 years ago

2.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.1

2 years ago

3.0.7

2 years ago

3.0.6

2 years ago

3.0.5

2 years ago

3.0.0

2 years ago

2.0.15

2 years ago

2.0.16

2 years ago

2.0.13

2 years ago

2.0.14

2 years ago

2.0.11

2 years ago

2.0.12

2 years ago

2.0.10

2 years ago

2.0.19

2 years ago

2.0.17

2 years ago

2.0.18

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.0

2 years ago