v4.0.0
⤴️ Node support:
💥BREAKING CHANGE: If still using lower than 14, no guarantee it will work...now or later.
Drop support for Node version less than 14.
Support for 14, 16, 18.
🧹Dependencies clean-up:
Update of all dependencies to latest, including node-forge
and protobujs
.
Removed non necessary dependencies (node-rsa
, safe-buffer
, base64-url
).
Pinned dependencies.
Applied same rules to /examples.
📖 Library API:
Renaming:
💥 BREAKING CHANGE: only affects the Yoti Identity Verification API, code must to be updated.
The terminology "doc-scan" is removed in favour of "idv".
Changes can be summarised as:
- class:
DocScanXxxx
renamed toIDVXxxx
- variable:
docScanXxxx
renamed toidvXxxx
Usage before
const {DocScanClient, DocScanConstants} = require('yoti')
const docScanClient = new DocScanClient(sdkId, pem);
Usage after
const {IDVClient, IDVConstants} = require('yoti')
const idvClient = new IDVClient(sdkId, pem);
Removal of deprecated methods:
💥 BREAKING CHANGE: only affects the Yoti Digital ID API, code may need to be updated.
Backward compatibility methods of the Profile and ActivityDetails have been removed, handling of attributes simplified and streamlined.
Deprecated | Replacement |
---|---|
ActivityDetails.getUserProfile() | ActivityDetails.getProfile() |
ActivityDetails.getUserId() | ActivityDetails.getRememberMeId() |
ActivityDetails.getBase64SelfieUri() | Profile.getSelfie().getValue().getBase64Content() |
Profile.propertyExists() | - |
Profile.getAttributes() | Profile.getAttributesList() |
Profile.getAgeVerified() | Profile.getAgeVerifications() Profile.findAgeOverVerification(age) Profile.findAgeUnderVerification(age) Profile.findAgeVerification(type, age) |
Removal of ByteBuffer:
💥 BREAKING CHANGE: only affects accessing Media's content.
As part of upgrading to protobufjs v7, the method getContent()
of any Media instance now returns a node Buffer and no longer an instance of ByteBuffer, so the ByteBuffer API is no longer accessible through content.
Changes for Digital ID (profile):
Usage before
const buffer = profile.attributes.selfie.value.content.getBuffer()
const buffer = profile.getSelfie().getValue().getContent.getBuffer()
Usage after
const buffer = profile.getSelfie().getValue().getContent()
Changes for IDV:
Given
const media = await IDVClient.getMediaContent(...)
// or
const media = await IDVService.getMediaContent(...)
Usage before
const { buffer } = media.getContent();
Usage after
const buffer = media.getContent();