@soyio/soyio-widget 0.0.17 → 0.0.18

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 CHANGED
@@ -10,23 +10,21 @@ For frontend frameworks, this should be imported as follows.
10
10
 
11
11
  ```html
12
12
  <script>
13
- const flow = '<flow>' // Can only take the values of 'register' or 'authenticate'
14
-
15
- const 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
-
22
- const onEvent = (data) => {
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(flow, configProps, onEvent)
27
+ new Widget(widgetConfig)
30
28
  });
31
29
  </script>
32
30