@authid/web-component 1.1.0 → 1.3.0
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/README.md +2 -0
- package/authid-web-component.js +17 -1
- package/example.html +1 -1
- package/package.json +20 -20
package/README.md
CHANGED
|
@@ -11,6 +11,8 @@ This integration is the most universal one as it can be used with any frontend t
|
|
|
11
11
|
- `data-url` - required parameter with operation/transaction URL received from authID,
|
|
12
12
|
- `data-target` - force selection of either `mobile` or `desktop` integration variant, `auto` is the default.
|
|
13
13
|
*NOTE: this parameter is obsolete, and it has no effect at the moment.*
|
|
14
|
+
- `data-webauth="true"` - enable automatic handling of Passkey features.
|
|
15
|
+
- `data-control="true"` - enable advanced control features.
|
|
14
16
|
|
|
15
17
|
## Example
|
|
16
18
|
|
package/authid-web-component.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2022 authID.ai (Ipsidy, Inc.)
|
|
2
|
+
* Copyright 2022-2023 authID.ai (Ipsidy, Inc.)
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -62,6 +62,22 @@ class AuthIDComponent extends HTMLElement {
|
|
|
62
62
|
shadow.appendChild(container);
|
|
63
63
|
shadow.appendChild(iframe);
|
|
64
64
|
|
|
65
|
+
const dataWebauth = this.getAttribute('data-webauth');
|
|
66
|
+
|
|
67
|
+
if (dataWebauth && dataWebauth !== 'false' && dataWebauth !== 'no') {
|
|
68
|
+
const webauthHandler = document.createElement('script');
|
|
69
|
+
webauthHandler.setAttribute('src', dataUrl.replace('/?', '/webauthhandler.js?'));
|
|
70
|
+
shadow.appendChild(webauthHandler);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const dataControl = this.getAttribute('data-control');
|
|
74
|
+
|
|
75
|
+
if (dataControl && dataControl !== 'false' && dataControl !== 'no') {
|
|
76
|
+
const controlHandler = document.createElement('script');
|
|
77
|
+
controlHandler.setAttribute('src', dataUrl.replace('/?', '/controlhandler.js?'));
|
|
78
|
+
shadow.appendChild(controlHandler);
|
|
79
|
+
}
|
|
80
|
+
|
|
65
81
|
iframe.addEventListener('load', () => {
|
|
66
82
|
shadow.removeChild(container);
|
|
67
83
|
}, { capture: true, once: true });
|
package/example.html
CHANGED
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
<script src="./authid-web-component.js"></script>
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
|
13
|
-
<authid-component data-url="https://id.
|
|
13
|
+
<authid-component data-url="https://id.authid.ai/?demo" data-webauth="true"></authid-component>
|
|
14
14
|
</body>
|
|
15
15
|
</html>
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@authid/web-component",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "authID integration as a Web Component",
|
|
5
|
-
"main": "authid-web-component.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "eslint --ext .js ."
|
|
8
|
-
},
|
|
9
|
-
"keywords": [
|
|
10
|
-
"authid",
|
|
11
|
-
"identity",
|
|
12
|
-
"authentication",
|
|
13
|
-
"kyc"
|
|
14
|
-
],
|
|
15
|
-
"author": "authID Team <team@authid.ai>",
|
|
16
|
-
"license": "Apache-2.0",
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"eslint": "^8.
|
|
19
|
-
}
|
|
20
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@authid/web-component",
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "authID integration as a Web Component",
|
|
5
|
+
"main": "authid-web-component.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "eslint --ext .js ."
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"authid",
|
|
11
|
+
"identity",
|
|
12
|
+
"authentication",
|
|
13
|
+
"kyc"
|
|
14
|
+
],
|
|
15
|
+
"author": "authID Team <team@authid.ai>",
|
|
16
|
+
"license": "Apache-2.0",
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"eslint": "^8.36.0"
|
|
19
|
+
}
|
|
20
|
+
}
|