Skip to content

SDK-2755 Share codes support#553

Merged
laurent-yoti merged 2 commits intodevelopmentfrom
SDK-2755-share-codes-support
Mar 18, 2026
Merged

SDK-2755 Share codes support#553
laurent-yoti merged 2 commits intodevelopmentfrom
SDK-2755-share-codes-support

Conversation

@laurent-yoti
Copy link
Copy Markdown
Collaborator

@laurent-yoti laurent-yoti commented Feb 2, 2026

Share-code

Create a session with Advanced Identity Profile

To enable the RTW Share Code - which acts as a fallback when documents provided are not RTW compatible, include an AdvancedIdentityProfileScheme with type GBR_RTW_SHARECODE in the AdvancedIdentityProfile of type YOTI_GLOBAL when defining the AdvancedIdentityProfileRequirements.

// Create RTW scheme
const advancedIdentityProfileSchemeRTW = new AdvancedIdentityProfileSchemeBuilder()
  .withType('RTW')
  .withLabel('label-for-RTW')
  .build();
// Setup advanced identity profile, with the RTW scheme for the UK_TFIDA framework
const advancedIdentityProfileUKTFIDA = new AdvancedIdentityProfileBuilder()
  .withTrustFramework('UK_TFIDA')
  .withScheme(advancedIdentityProfileSchemeRTW)
  .build();

// NEW - Setup advanced identity profile, with the GBR_RTW_SHARECODE scheme
const advancedIdentityProfileSchemeGbrRtwSharecode = new AdvancedIdentityProfileSchemeBuilder()
  .withType('GBR_RTW_SHARECODE')
  .withLabel('label-for-GBR-RTW-SHARECODE')
  .build();
// Setup advanced identity profile, with the GBR_RTW_SHARECODE scheme for the YOTI_GLOBAL framework
const advancedIdentityProfileYotiGlobal = new AdvancedIdentityProfileBuilder()
  .withTrustFramework('YOTI_GLOBAL')
  .withScheme(advancedIdentityProfileSchemeGbrRtwSharecode)
  .build();

// Finally assemble an advanced identity profile requirements, using the two profiles
const advancedIdentityProfileRequirements = new AdvancedIdentityProfileRequirementsBuilder()
  .withProfile(advancedIdentityProfileUKTFIDA)
  .withProfile(advancedIdentityProfileYotiGlobal)
  .build();

Retrieve session

Given a session is retrieved, there can be multiple share code resources (as per the user attempts) but only one is successful (eg, include collected details):

    const sessionResult = await idvClient.getSession(sessionId);
    const shareCodeResources = sessionResult.getResources().getShareCodeResources();
    const firstShareCodeResource = shareCodeResources[0];

    // Submitted details (share-code and date of birth)
    const lookupProfileMedia = firstShareCodeResource.getLookupProfile().getMedia();
    // Collected details (full-name and RTW expiration date)
    const returnedProfileMedia = firstShareCodeResource.getReturnedProfile().getMedia();
    // Collected PDF file media
    const pdfFileMedia = firstShareCodeResource.getFile().getMedia();
    // Collected ID Photo media
    const idPhotoMedia = firstShareCodeResource.getIdPhoto().getMedia();

@laurent-yoti laurent-yoti force-pushed the SDK-2755-share-codes-support branch 4 times, most recently from e0addd9 to 2a96878 Compare February 2, 2026 13:33
@laurent-yoti laurent-yoti force-pushed the SDK-2755-share-codes-support branch from 2a96878 to ad3bc01 Compare February 2, 2026 13:54
@laurent-yoti laurent-yoti changed the base branch from master to development February 2, 2026 14:11
Comment thread tests/idv_service/session/retrieve/share.code.response.spec.js
Comment thread src/idv_service/session/create/required.share.code.payload.js Outdated
Comment thread src/idv_service/session/create/session.specification.js Outdated
@laurent-yoti laurent-yoti force-pushed the SDK-2755-share-codes-support branch from e608256 to 7844b99 Compare March 13, 2026 08:48
…DE` in the advanced identity profile option, and added a second case that focuses only on RTW and the share code fallback
@laurent-yoti laurent-yoti merged commit dd5561a into development Mar 18, 2026
15 checks passed
laurent-yoti added a commit that referenced this pull request Mar 27, 2026
* Added new resources for share code retrieval

* Updated /examples/idv-identity-checks to include the `GBR_RTW_SHARECODE` in the advanced identity profile option, and added a second case that focuses only on RTW and the share code fallback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants