@soyio/soyio-widget 0.0.17 → 0.0.19
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 +11 -13
- package/dist/index.js +803 -781
- package/dist/index.umd.cjs +10 -10
- package/dist/src/constants.d.ts +2 -1
- package/dist/src/index.d.ts +3 -2
- package/dist/src/utils.d.ts +1 -0
- package/dist/src/widget.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,23 +10,21 @@ For frontend frameworks, this should be imported as follows.
|
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
12
|
<script>
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
console.log('APPLICATION: EVENT!');
|
|
24
|
-
console.log(data);
|
|
13
|
+
const widgetConfig = {
|
|
14
|
+
flow: '<flow>' // Can only take the values of 'register' or 'authenticate'
|
|
15
|
+
configProps = {
|
|
16
|
+
companyId: '<company id>', // Starts with 'com_'
|
|
17
|
+
userReference?: '<user identifier of company>' // Optional
|
|
18
|
+
flowTemplateId: '<flow template id', // Starts with 'vft_' only needed in 'register' flow
|
|
19
|
+
identityId: '<identity id>' // Starts with 'id_' only needed in 'authenticate' flow
|
|
20
|
+
}
|
|
21
|
+
onEvent: (data) => console.log('Data: ', data),
|
|
22
|
+
isSandbox: true // Optional. Default is false.
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
// Create widget when needed. In this example, widget is created when page is loaded.
|
|
28
26
|
document.addEventListener('DOMContentLoaded', function() {
|
|
29
|
-
new Widget(
|
|
27
|
+
new Widget(widgetConfig)
|
|
30
28
|
});
|
|
31
29
|
</script>
|
|
32
30
|
|