@jackk5/clone-sdk-lib v3.0.7
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 cardlivenessinit
- Initialize model cardvalidate
- get avideo element
asinput
and return acallback function
asoutput
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 facelivenessinit
- Initialize model facerenderPrediction
- get avideo element
asinput
andoutput
is 2 functionhandleMediapipeModelCallback
andonFaceModelCallBack
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.
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago