@onfido/api 4.5.0 → 5.0.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 +22 -13
- package/dist/api.d.ts +142 -179
- package/dist/api.js +89 -38
- package/dist/configuration.js +1 -1
- package/dist/esm/api.d.ts +142 -179
- package/dist/esm/api.js +87 -36
- package/dist/esm/configuration.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,9 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
The official Node.js library for integrating with the Onfido API.
|
|
4
4
|
|
|
5
|
-
Documentation
|
|
5
|
+
Documentation is available at <https://documentation.onfido.com>.
|
|
6
6
|
|
|
7
|
-
This library is
|
|
7
|
+
This library is for backend use only, as it requires secret Onfido API tokens and should not be used in the frontend due to security reasons.
|
|
8
|
+
|
|
9
|
+
If you need to collect applicant data in the frontend of your application, we recommend that you use the Onfido SDKs:
|
|
10
|
+
|
|
11
|
+
- [iOS](https://github.com/onfido/onfido-ios-sdk)
|
|
12
|
+
- [Android](https://github.com/onfido/onfido-android-sdk)
|
|
13
|
+
- [Web](https://github.com/onfido/onfido-sdk-ui)
|
|
14
|
+
- [React Native](https://github.com/onfido/react-native-sdk)
|
|
8
15
|
|
|
9
16
|
This version uses Onfido API v3.6. Refer to our [API versioning guide](https://developers.onfido.com/guide/api-versioning-policy#client-libraries) for details of which client library versions use which versions of the API.
|
|
10
17
|
|
|
@@ -58,7 +65,7 @@ Configure with your API token and region:
|
|
|
58
65
|
const onfido = new DefaultApi(
|
|
59
66
|
new Configuration({
|
|
60
67
|
apiToken: process.env.ONFIDO_API_TOKEN,
|
|
61
|
-
region: Region.EU, // Supports Region.EU, Region.US and Region.CA
|
|
68
|
+
region: Region.EU, // Supports Region.EU (Europe), Region.US (United States), and Region.CA (Canada)
|
|
62
69
|
baseOptions: { timeout: 60_000 } // Additional Axios options (timeout, etc.)
|
|
63
70
|
})
|
|
64
71
|
);
|
|
@@ -162,7 +169,7 @@ onfido.uploadDocument(
|
|
|
162
169
|
|
|
163
170
|
### Webhook event verification
|
|
164
171
|
|
|
165
|
-
Webhook events payload needs to be verified before it can be accessed.
|
|
172
|
+
Webhook events payload needs to be verified before it can be accessed. Verifying webhook payloads is crucial for security reasons, as it ensures that the payloads are indeed from Onfido and have not been tampered with. The library allows you to easily decode the payload and verify its signature before returning it as an object for user convenience:
|
|
166
173
|
|
|
167
174
|
```js
|
|
168
175
|
(async () => {
|
|
@@ -184,41 +191,43 @@ Webhook events payload needs to be verified before it can be accessed. Library a
|
|
|
184
191
|
|
|
185
192
|
#### Do not use square bracket syntax
|
|
186
193
|
|
|
187
|
-
Except for accessing Task object's outputs,
|
|
194
|
+
Except for accessing Task object's outputs, avoid using the square bracket syntax (i.e. `[]`) to access undefined properties to prevent breaking changes when these fields appear.
|
|
188
195
|
|
|
189
196
|
## Contributing
|
|
190
197
|
|
|
191
|
-
This library is automatically generated using [OpenAPI Generator](https://openapi-generator.tech) (version: 7.
|
|
198
|
+
This library is automatically generated using [OpenAPI Generator](https://openapi-generator.tech) (version: 7.11.0); therefore, all contributions (except test files) should target the [Onfido OpenAPI specification repository](https://github.com/onfido/onfido-openapi-spec/tree/master) instead of this repository. Please follow the contribution guidelines provided in the OpenAPI specification repository.
|
|
192
199
|
|
|
193
200
|
For contributions to the tests instead, please follow the steps below:
|
|
194
201
|
|
|
195
|
-
1. [
|
|
202
|
+
1. Fork the [repository](https://github.com/onfido/onfido-node/fork)
|
|
196
203
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
197
204
|
3. Make your changes
|
|
198
|
-
4. Commit your changes (`git commit -am 'Add
|
|
205
|
+
4. Commit your changes (`git commit -am 'Add detailed description of the feature'`)
|
|
199
206
|
5. Push to the branch (`git push origin my-new-feature`)
|
|
200
207
|
6. Create a new Pull Request
|
|
201
208
|
|
|
202
209
|
## Versioning policy
|
|
203
210
|
|
|
204
|
-
|
|
211
|
+
Versioning helps manage changes and ensures compatibility across different versions of the library.
|
|
212
|
+
|
|
213
|
+
[Semantic Versioning](https://semver.org) policy is used for library versioning, following the guidelines and limitations outlined below:
|
|
205
214
|
|
|
206
|
-
- MAJOR versions (x.0.0)
|
|
215
|
+
- MAJOR versions (x.0.0) may:
|
|
207
216
|
- target a new API version
|
|
208
217
|
- include non-backward compatible change
|
|
209
|
-
- MINOR versions (0.x.0)
|
|
218
|
+
- MINOR versions (0.x.0) may:
|
|
210
219
|
- add a new functionality, non-mandatory parameter or property
|
|
211
220
|
- deprecate an old functionality
|
|
212
221
|
- include non-backward compatible change to a functionality which is:
|
|
213
222
|
- labelled as alpha or beta
|
|
214
223
|
- completely broken and not usable
|
|
215
|
-
- PATCH version (0.0.x)
|
|
224
|
+
- PATCH version (0.0.x) will:
|
|
216
225
|
- fix a bug
|
|
217
226
|
- include backward compatible changes only
|
|
218
227
|
|
|
219
228
|
## More documentation
|
|
220
229
|
|
|
221
|
-
|
|
230
|
+
Additional documentation and code examples can be found at <https://documentation.onfido.com>.
|
|
222
231
|
|
|
223
232
|
## Support
|
|
224
233
|
|