sonic-widget 1.44.0 → 1.45.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 +19 -3
- package/dist/index.js +2058 -2058
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
Use this script tag to get access to the widget:
|
|
6
6
|
|
|
7
7
|
```html
|
|
8
|
-
<script src="https://cdn.jsdelivr.net/npm/sonic-widget@1.
|
|
8
|
+
<script src="https://cdn.jsdelivr.net/npm/sonic-widget@1.45.0/dist/index.min.js"></script>
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
or
|
|
@@ -32,7 +32,7 @@ and adding path in `angular.json`
|
|
|
32
32
|
2. Use this script tag to get access to the widget at initial html page:
|
|
33
33
|
|
|
34
34
|
```html
|
|
35
|
-
<script src="https://cdn.jsdelivr.net/npm/sonic-widget@1.
|
|
35
|
+
<script src="https://cdn.jsdelivr.net/npm/sonic-widget@1.45.0/dist/index.min.js"></script>
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
or
|
|
@@ -71,6 +71,7 @@ ngOnInit(): void {
|
|
|
71
71
|
showPage: boolean, // used to show the page or not
|
|
72
72
|
ipInfoKey: string, // api key to detect vpn used or not from "ipInfo.io" (Optional)
|
|
73
73
|
videoURL: string, // url of video to do (e.g: demo doing kyc) (Optional)
|
|
74
|
+
appId: string, // application policy identifier
|
|
74
75
|
accountId: string, // account can be taken from operator axiom account
|
|
75
76
|
userName: string, // user prospective data
|
|
76
77
|
userId: string, // user document number to identity
|
|
@@ -113,7 +114,7 @@ ngOnInit(): void {
|
|
|
113
114
|
4. Add a Script tag to the head tag or body tag. And use the latest version.
|
|
114
115
|
|
|
115
116
|
```html
|
|
116
|
-
<script src="https://cdn.jsdelivr.net/npm/sonic-widget@1.
|
|
117
|
+
<script src="https://cdn.jsdelivr.net/npm/sonic-widget@1.45.0/dist/index.min.js"></script>
|
|
117
118
|
```
|
|
118
119
|
|
|
119
120
|
5. Next, add the script tag at a necessary place. But add below the widget script.
|
|
@@ -125,6 +126,7 @@ ngOnInit(): void {
|
|
|
125
126
|
showPage: boolean, // used to show the page or not
|
|
126
127
|
ipInfoKey: string, // api key to detect vpn used or not from "ipInfo.io" (Optional)
|
|
127
128
|
videoURL: string, // url of video to do (e.g: demo doing kyc) (Optional)
|
|
129
|
+
appId: string, // application policy identifier
|
|
128
130
|
accountId: string, // account can be taken from operator axiom account
|
|
129
131
|
userName: string, // user prospective data
|
|
130
132
|
userId: string, // user document number to identity
|
|
@@ -146,6 +148,19 @@ ngOnInit(): void {
|
|
|
146
148
|
_Here, the config variable is used to pass the data. And the container variable is to get the dom element of the id **`xxxx`** button and add it to the event listener. It checks if the button is clicked and sends the config object data to the **`sonic`** module.
|
|
147
149
|
**`sonic.SonicWidget(config)`**_
|
|
148
150
|
|
|
151
|
+
|
|
152
|
+
_You can get the logs with **`onMessage`** for all actions and stages.
|
|
153
|
+
Check with **`data.code`**_
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
0 - info message from application
|
|
157
|
+
1 - success api call
|
|
158
|
+
-1 - failed api call
|
|
159
|
+
-2 - error message from application
|
|
160
|
+
-3 - configuration error message
|
|
161
|
+
2 - on close application
|
|
162
|
+
```
|
|
163
|
+
|
|
149
164
|
**Note:-**
|
|
150
165
|
|
|
151
166
|
- _**`baseurl`** should pass as a string value. It is used as the base URL for API calls._
|
|
@@ -154,6 +169,7 @@ _Here, the config variable is used to pass the data. And the container variable
|
|
|
154
169
|
- _**`videoURL`** should pass as a string value as url. It is used to show the video onboard sonic kyc._
|
|
155
170
|
- _**`accountId`** should pass as a string value. It is used to get the JWT token and proceed with the operator account._
|
|
156
171
|
- _**`isMalay`** is used to pass a boolean value ( **`true`** or **`false`** ). To toggle the widget default language english or malay._
|
|
172
|
+
- _**`appId`** should pass as a string value. It is used to find an application policy for onboard sonic kyc._
|
|
157
173
|
- _**`userName`** should pass as a string value. It is used to create an application for onboard sonic kyc._
|
|
158
174
|
- _**`userId`** should pass as a string value. It is used to create an application for onboard sonic kyc and to compare your identity with the document._
|
|
159
175
|
- _**`email`** should pass as a string value. It is used to create an application for onboard sonic kyc and it is optional._
|