@faceio/fiojs 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/npm-publish.yml +33 -0
- package/LICENSE +201 -201
- package/README.md +328 -321
- package/index.js +70 -70
- package/package.json +17 -13
package/index.js
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
/*eslint no-undef: 0*/
|
|
2
|
-
let internalCDN;
|
|
3
|
-
|
|
4
|
-
module.exports = class faceio {
|
|
5
|
-
constructor(appID){
|
|
6
|
-
if(internalCDN) return;
|
|
7
|
-
|
|
8
|
-
let script = document.createElement('script')
|
|
9
|
-
|
|
10
|
-
script.setAttribute('src', 'https://cdn.faceio.net/fio.js');
|
|
11
|
-
|
|
12
|
-
document.head.appendChild(script);
|
|
13
|
-
|
|
14
|
-
script.addEventListener('load', () => {
|
|
15
|
-
internalCDN = new faceIO(appID)
|
|
16
|
-
})
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Enroll new user.
|
|
20
|
-
* @param {Object} parameters enroll() takes a single, optional parameters object with the properties to be configured.
|
|
21
|
-
* @param {Object} parameters.payload An arbitrary set of data, you want to associate with the user being enrolled.
|
|
22
|
-
* @param {Number} parameters.permissionTimeout Total number of seconds to wait for the user to grant camera access permission.
|
|
23
|
-
* @param {Number} parameters.termsTimeout Total number of minutes to wait for the user to accept FACEIO/Host Application Terms of Service.
|
|
24
|
-
* @param {Number} parameters.idleTimeout Total number of seconds to wait before giving up if no faces were detected during the enrollment process.
|
|
25
|
-
* @param {Number} parameters.replyTimeout Total number of seconds to wait before giving up if the remote FACEIO processing node does not return a response (a very unlikely scenario).
|
|
26
|
-
* @param {Number} parameters.enrollIntroTimeout Enrollment Widget introduction/instruction screen display delay.
|
|
27
|
-
* @param {String} parameters.locale Default interaction language for the Widget display.
|
|
28
|
-
* @param {Boolean} parameters.userConsent If you have already collected user consent before enrollment (eg. When the user create a new account on your Website and accept the terms), you can set this parameter to true.
|
|
29
|
-
* @returns {String} facialId: A Universally Unique Identifier assigned to this particular user.
|
|
30
|
-
* @returns {String} timestamp: ISO 8601, enrollment completion date & time.
|
|
31
|
-
* @returns {Object} details: An object with two fields: gender and age which respectively corresponds to the Gender and Age approximation of the enrolled user.
|
|
32
|
-
* @example
|
|
33
|
-
* faceio.enroll({
|
|
34
|
-
* "locale": "auto", // Default user locale
|
|
35
|
-
* "payload": {
|
|
36
|
-
* "whoami": 123456, // Dummy ID linked to this particular user
|
|
37
|
-
* "email": "john.doe@example.com"
|
|
38
|
-
* }
|
|
39
|
-
* });
|
|
40
|
-
*/
|
|
41
|
-
async enroll(parameters) {
|
|
42
|
-
return await internalCDN.enroll(parameters)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Transactionally authenticate previously enrolled users.
|
|
47
|
-
* @param {Object} parameters authenticate() takes a single, optional parameters object with the properties to be configured.
|
|
48
|
-
* @param {Number} parameters.permissionTimeout Total number of seconds to wait for the user to grant camera access permission.
|
|
49
|
-
* @param {Number} parameters.idleTimeout Total number of seconds to wait before giving up if no faces were detected during the authentication process.
|
|
50
|
-
* @param {Number} parameters.replyTimeout Total number of seconds to wait before giving up if the remote FACEIO processing node does not return a response (a very unlikely scenario)
|
|
51
|
-
* @param {String} parameters.locale Default interaction language of the FACEIO Widget.
|
|
52
|
-
* @returns {any} payload: The arbitrary data you have already linked (if any) to this particular user during his enrollment via the payload parameter of the enroll() method.
|
|
53
|
-
* @returns {String} facialId: A Universally Unique Identifier assigned to this particular user.
|
|
54
|
-
* @example
|
|
55
|
-
* faceio.authenticate({
|
|
56
|
-
* "locale": "auto" // Default user locale
|
|
57
|
-
* });
|
|
58
|
-
*/
|
|
59
|
-
async authenticate(parameters) {
|
|
60
|
-
return await internalCDN.authenticate(parameters)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Purge the current session and request a new one.
|
|
65
|
-
* @returns true if the request for a new session have been granted, and ready for another round of calls to enroll() or authenticate() for the same user. false otherwise.
|
|
66
|
-
*/
|
|
67
|
-
|
|
68
|
-
async restartSession() {
|
|
69
|
-
return await internalCDN.restartSession()
|
|
70
|
-
}
|
|
1
|
+
/*eslint no-undef: 0*/
|
|
2
|
+
let internalCDN;
|
|
3
|
+
|
|
4
|
+
module.exports = class faceio {
|
|
5
|
+
constructor(appID){
|
|
6
|
+
if(internalCDN) return;
|
|
7
|
+
|
|
8
|
+
let script = document.createElement('script')
|
|
9
|
+
|
|
10
|
+
script.setAttribute('src', 'https://cdn.faceio.net/fio.js');
|
|
11
|
+
|
|
12
|
+
document.head.appendChild(script);
|
|
13
|
+
|
|
14
|
+
script.addEventListener('load', () => {
|
|
15
|
+
internalCDN = new faceIO(appID)
|
|
16
|
+
})
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Enroll new user.
|
|
20
|
+
* @param {Object} parameters enroll() takes a single, optional parameters object with the properties to be configured.
|
|
21
|
+
* @param {Object} parameters.payload An arbitrary set of data, you want to associate with the user being enrolled.
|
|
22
|
+
* @param {Number} parameters.permissionTimeout Total number of seconds to wait for the user to grant camera access permission.
|
|
23
|
+
* @param {Number} parameters.termsTimeout Total number of minutes to wait for the user to accept FACEIO/Host Application Terms of Service.
|
|
24
|
+
* @param {Number} parameters.idleTimeout Total number of seconds to wait before giving up if no faces were detected during the enrollment process.
|
|
25
|
+
* @param {Number} parameters.replyTimeout Total number of seconds to wait before giving up if the remote FACEIO processing node does not return a response (a very unlikely scenario).
|
|
26
|
+
* @param {Number} parameters.enrollIntroTimeout Enrollment Widget introduction/instruction screen display delay.
|
|
27
|
+
* @param {String} parameters.locale Default interaction language for the Widget display.
|
|
28
|
+
* @param {Boolean} parameters.userConsent If you have already collected user consent before enrollment (eg. When the user create a new account on your Website and accept the terms), you can set this parameter to true.
|
|
29
|
+
* @returns {String} facialId: A Universally Unique Identifier assigned to this particular user.
|
|
30
|
+
* @returns {String} timestamp: ISO 8601, enrollment completion date & time.
|
|
31
|
+
* @returns {Object} details: An object with two fields: gender and age which respectively corresponds to the Gender and Age approximation of the enrolled user.
|
|
32
|
+
* @example
|
|
33
|
+
* faceio.enroll({
|
|
34
|
+
* "locale": "auto", // Default user locale
|
|
35
|
+
* "payload": {
|
|
36
|
+
* "whoami": 123456, // Dummy ID linked to this particular user
|
|
37
|
+
* "email": "john.doe@example.com"
|
|
38
|
+
* }
|
|
39
|
+
* });
|
|
40
|
+
*/
|
|
41
|
+
async enroll(parameters) {
|
|
42
|
+
return await internalCDN.enroll(parameters)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Transactionally authenticate previously enrolled users.
|
|
47
|
+
* @param {Object} parameters authenticate() takes a single, optional parameters object with the properties to be configured.
|
|
48
|
+
* @param {Number} parameters.permissionTimeout Total number of seconds to wait for the user to grant camera access permission.
|
|
49
|
+
* @param {Number} parameters.idleTimeout Total number of seconds to wait before giving up if no faces were detected during the authentication process.
|
|
50
|
+
* @param {Number} parameters.replyTimeout Total number of seconds to wait before giving up if the remote FACEIO processing node does not return a response (a very unlikely scenario)
|
|
51
|
+
* @param {String} parameters.locale Default interaction language of the FACEIO Widget.
|
|
52
|
+
* @returns {any} payload: The arbitrary data you have already linked (if any) to this particular user during his enrollment via the payload parameter of the enroll() method.
|
|
53
|
+
* @returns {String} facialId: A Universally Unique Identifier assigned to this particular user.
|
|
54
|
+
* @example
|
|
55
|
+
* faceio.authenticate({
|
|
56
|
+
* "locale": "auto" // Default user locale
|
|
57
|
+
* });
|
|
58
|
+
*/
|
|
59
|
+
async authenticate(parameters) {
|
|
60
|
+
return await internalCDN.authenticate(parameters)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Purge the current session and request a new one.
|
|
65
|
+
* @returns true if the request for a new session have been granted, and ready for another round of calls to enroll() or authenticate() for the same user. false otherwise.
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
async restartSession() {
|
|
69
|
+
return await internalCDN.restartSession()
|
|
70
|
+
}
|
|
71
71
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@faceio/fiojs",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Facial Authentication for the Web",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"homepage": "https://faceio.net/",
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
},
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@faceio/fiojs",
|
|
3
|
+
"version": "1.0.7",
|
|
4
|
+
"description": "Facial Authentication for the Web",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"homepage": "https://faceio.net/",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+ssh://git@github.com/symisc/faceio-npm.git"
|
|
10
|
+
},
|
|
11
|
+
"license": "APACHE 2",
|
|
12
|
+
"scripts": {
|
|
13
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
14
|
+
},
|
|
15
|
+
"keywords": ["facial authentication", "Biometric authentication", "face recognition", "passwordless authentication", "face identification","face biometrics", "facial authentication", "passwordless authentication"],
|
|
16
|
+
"author": "PixLab | Symisc Systems - https://faceio.net"
|
|
17
|
+
}
|