@soyio/soyio-widget 1.0.8 → 1.0.10

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
@@ -32,7 +32,7 @@ Integrate the widget into your frontend framework using the script below. Ensure
32
32
 
33
33
  ```html
34
34
  <script>
35
- import { SoyioWidget } from '@soyio/soyio-widget';
35
+ import { SoyioWidget } from "@soyio/soyio-widget";
36
36
 
37
37
  // Widget configuration
38
38
  const widgetConfig = {
@@ -43,7 +43,7 @@ Integrate the widget into your frontend framework using the script below. Ensure
43
43
  userEmail: "<user email>",
44
44
  flowTemplateId: "<flow template id>",
45
45
  forceError: "<error type>",
46
- customColor: "<custom color>"
46
+ customColor: "<custom color>",
47
47
  },
48
48
  onEvent: (data) => console.log(data),
49
49
  isSandbox: true,
@@ -57,16 +57,17 @@ Integrate the widget into your frontend framework using the script below. Ensure
57
57
  ```
58
58
 
59
59
  Optional props:
60
- * `userReference`
61
- * `userEmail`
62
- * `forceError`
63
- * `customColor`.
60
+
61
+ - `userReference`
62
+ - `userEmail`
63
+ - `forceError`
64
+ - `customColor`.
64
65
 
65
66
  ### 2. Auth attempt
66
67
 
67
68
  ```html
68
69
  <script>
69
- import { SoyioWidget } from '@soyio/soyio-widget';
70
+ import { SoyioWidget } from "@soyio/soyio-widget";
70
71
 
71
72
  // Widget configuration
72
73
  const widgetConfig = {
@@ -76,7 +77,7 @@ Optional props:
76
77
  userReference: "<user identifier of company>",
77
78
  identityId: "<identity id>",
78
79
  forceError: "<error type>",
79
- customColor: "<custom color>"
80
+ customColor: "<custom color>",
80
81
  },
81
82
  onEvent: (data) => console.log(data),
82
83
  isSandbox: true,
@@ -90,26 +91,24 @@ Optional props:
90
91
  ```
91
92
 
92
93
  Optional props:
93
- * `userReference`
94
- * `forceError`
95
- * `customColor`.
96
94
 
97
- ### 3. Signature attempt (*coming soon...*)
95
+ - `userReference`
96
+ - `forceError`
97
+ - `customColor`.
98
+
99
+ ### 3. Signature attempt
98
100
 
99
101
  ```html
100
102
  <script>
101
- import { SoyioWidget } from '@soyio/soyio-widget';
103
+ import { SoyioWidget } from "@soyio/soyio-widget";
102
104
 
103
105
  // Widget configuration
104
106
  const widgetConfig = {
105
107
  flow: "signature",
106
108
  configProps: {
107
- companyId: "<company id>",
108
- userReference: "<user identifier of company>",
109
- signatureTemplateId: "<signature template id>",
110
- identityId: "<identity id>",
109
+ signatureAttemptId: "<signature attempt id>",
111
110
  forceError: "<error type>",
112
- customColor: "<custom color>"
111
+ customColor: "<custom color>",
113
112
  },
114
113
  onEvent: (data) => console.log(data),
115
114
  isSandbox: true,
@@ -123,9 +122,9 @@ Optional props:
123
122
  ```
124
123
 
125
124
  Optional props:
126
- * `userReference`
127
- * `forceError`
128
- * `customColor`.
125
+
126
+ - `forceError`
127
+ - `customColor`.
129
128
 
130
129
  ### Attribute Descriptions
131
130
 
@@ -133,7 +132,7 @@ Optional props:
133
132
  - **`userReference`**: A reference identifier provided by the company for the user engaging with the widget. This identifier is used in events (`onEvent` and `webhooks`) to inform the company which user the events are associated with.
134
133
  - **`userEmail`**: The user's email address. If not provided, Soyio will prompt the user to enter their email.
135
134
  - **`flowTemplateId`**: Identifier of template. Specifies the order and quantity of documents requested from the user. It must start with `'vt_'`.
136
- - **`signatureTemplateId`**: Identifier of template. Specifies the order and quantity of documents to sign. It must start with `'st_'`.
135
+ - **`signatureAttemptId`**: Identifier of signature attempt obtained when creating the `SignatureAttempt`. It must start with `'sa_'`.
137
136
  - **`identityId`**: This identifier must start with `'id_'` and signifies the user's identity.
138
137
  - **`isSandbox`**: Indicates if the widget should operate in sandbox mode, defaulting to `false`.
139
138
  - **`forceError`**: Triggers specific errors for testing or debugging. Used to simulate failure scenarios. Only works in `sandbox` mode.
@@ -164,6 +163,11 @@ The `onEvent` callback is designed to handle various events that occur during wi
164
163
 
165
164
  - **`DENIED_CAMERA_PERMISSION`**: Event triggered when user denies camera permissions. It closes the widget.
166
165
 
166
+ - **`REJECTED_SIGNATURE`**: Event triggered when user clicks the "reject" button in the signature attempt. The event object includes:
167
+
168
+ - `identityId`: The unique identifier for the identity.
169
+ - `userReference`: The userReference used in the validation attempt for the identity.
170
+
167
171
  - **`WIDGET_CLOSED`**: This event occurs when the user closes the `Soyio` pop up. The event object is as follows:
168
172
 
169
173
  - `{ eventName: 'WIDGET_CLOSED' }`.
@@ -175,7 +179,6 @@ The `onEvent` callback is designed to handle various events that occur during wi
175
179
 
176
180
  The `forceError` parameter can simulate the following error conditions:
177
181
 
178
-
179
182
  - `'facial_validation_error'`: Simulates a failure in the facial video liveness test, indicating the system could not verify the user's live presence.
180
183
  - `'document_validation_error'`: Indicates an issue with validating the photos of the documents provided by the user.
181
184
  - `'unknown_error'`: Generates a generic error, representing an unspecified problem.
@@ -189,5 +192,5 @@ The `SoyioTypes` module from the `@soyio/soyio-widget` package provides TypeScri
189
192
  To use the `SoyioTypes` in your project, import it directly from the `@soyio/soyio-widget` package:
190
193
 
191
194
  ```javascript
192
- import { SoyioTypes } from '@soyio/soyio-widget'
195
+ import type { SoyioTypes } from "@soyio/soyio-widget";
193
196
  ```
package/dist/index.d.ts CHANGED
@@ -35,10 +35,7 @@ declare type SignatureAttemptConfig = {
35
35
  };
36
36
 
37
37
  declare type SignatureAttemptProps = {
38
- companyId: string;
39
- identityId: string;
40
- signatureTemplateId: string;
41
- userReference?: string;
38
+ signatureAttemptId: string;
42
39
  forceError?: ForceErrors;
43
40
  customColor?: string;
44
41
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soyio/soyio-widget",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",