@soyio/soyio-widget 1.0.8 → 1.0.9
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 +20 -22
- package/dist/index.d.ts +1 -4
- package/package.json +1 -1
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
|
|
35
|
+
import { SoyioWidget } from "@soyio/soyio-widget";
|
|
36
36
|
|
|
37
37
|
// Widget configuration
|
|
38
38
|
const widgetConfig = {
|
|
@@ -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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
|
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,24 +91,22 @@ Optional props:
|
|
|
90
91
|
```
|
|
91
92
|
|
|
92
93
|
Optional props:
|
|
93
|
-
* `userReference`
|
|
94
|
-
* `forceError`
|
|
95
|
-
* `customColor`.
|
|
96
94
|
|
|
97
|
-
|
|
95
|
+
- `userReference`
|
|
96
|
+
- `forceError`
|
|
97
|
+
- `customColor`.
|
|
98
|
+
|
|
99
|
+
### 3. Signature attempt (_coming soon..._)
|
|
98
100
|
|
|
99
101
|
```html
|
|
100
102
|
<script>
|
|
101
|
-
import { SoyioWidget } from
|
|
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
|
-
|
|
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
111
|
customColor: "<custom color>"
|
|
113
112
|
},
|
|
@@ -123,9 +122,9 @@ Optional props:
|
|
|
123
122
|
```
|
|
124
123
|
|
|
125
124
|
Optional props:
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
-
- **`
|
|
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.
|
|
@@ -175,7 +174,6 @@ The `onEvent` callback is designed to handle various events that occur during wi
|
|
|
175
174
|
|
|
176
175
|
The `forceError` parameter can simulate the following error conditions:
|
|
177
176
|
|
|
178
|
-
|
|
179
177
|
- `'facial_validation_error'`: Simulates a failure in the facial video liveness test, indicating the system could not verify the user's live presence.
|
|
180
178
|
- `'document_validation_error'`: Indicates an issue with validating the photos of the documents provided by the user.
|
|
181
179
|
- `'unknown_error'`: Generates a generic error, representing an unspecified problem.
|
|
@@ -189,5 +187,5 @@ The `SoyioTypes` module from the `@soyio/soyio-widget` package provides TypeScri
|
|
|
189
187
|
To use the `SoyioTypes` in your project, import it directly from the `@soyio/soyio-widget` package:
|
|
190
188
|
|
|
191
189
|
```javascript
|
|
192
|
-
import { SoyioTypes } from
|
|
190
|
+
import type { SoyioTypes } from "@soyio/soyio-widget";
|
|
193
191
|
```
|
package/dist/index.d.ts
CHANGED
|
@@ -35,10 +35,7 @@ declare type SignatureAttemptConfig = {
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
declare type SignatureAttemptProps = {
|
|
38
|
-
|
|
39
|
-
identityId: string;
|
|
40
|
-
signatureTemplateId: string;
|
|
41
|
-
userReference?: string;
|
|
38
|
+
signatureAttemptId: string;
|
|
42
39
|
forceError?: ForceErrors;
|
|
43
40
|
customColor?: string;
|
|
44
41
|
};
|