@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 elementasinputand return acallback functionasoutputoutputcontains- 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 elementasinputandoutputis 2 functionhandleMediapipeModelCallbackandonFaceModelCallBackonFaceDetectionCallBackis called each frame on video element- success (boolean): return true if have valid face and one face
- message (string): corresponding message
onFaceModelCallBackis 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 .gitOpen config file
Replace url in [remote "origin"] with
url = https://Techainer-admin:TOKEN@github.com/Techainer/web-sdk-libTOKEN 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 loginThen enter your username, password, email to login into npm in local.
Step5: Publish into npm
Run command
npm publishto 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.comInstall npm package
yarn add @techainer/web-sdk-lib@versionor
npm install @techainer/web-sdk-lib@versionImport lib into Component
import{CardLiveness,FaceLiveness}from "@techainer/web-sdk-lib"Now you can use.
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago