Skip to content

Commit

Permalink
SDK-2381: Update IDV example project defaults (#420)
Browse files Browse the repository at this point in the history
Updated IDV examples so sessions configurations uses more desirable values.
  • Loading branch information
nikhilPank authored and laurent-yoti committed Jan 2, 2024
1 parent f0e17b6 commit 4af456d
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ const config = require('../../config');
* Create an IDV session.
*/
async function createSession() {
const idvClient = new IDVClient(
config.YOTI_CLIENT_SDK_ID,
config.YOTI_PEM
);
const idvClient = new IDVClient(config.YOTI_CLIENT_SDK_ID, config.YOTI_PEM);

const subject = {
subject_id: 'subject_id_string',
Expand All @@ -28,7 +25,7 @@ async function createSession() {

const sessionSpec = new SessionSpecificationBuilder()
.withClientSessionTokenTtl(600)
.withResourcesTtl(90000)
.withResourcesTtl(86400)
.withUserTrackingId('some-user-tracking-id')
.withSubject(subject)
.withIdentityProfileRequirements(identityProfileRequirements)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ async function createSession() {

const sessionSpec = new SessionSpecificationBuilder()
.withClientSessionTokenTtl(600)
.withResourcesTtl(90000)
.withResourcesTtl(86400)
.withUserTrackingId('some-user-tracking-id')
.withRequestedTask(
new RequestedTextExtractionTaskBuilder()
.withManualCheckAlways()
.withManualCheckFallback()
.build()
)
// With OrthogonalRestrictionsFilterBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ async function createSession() {

const sessionSpec = new SessionSpecificationBuilder()
.withClientSessionTokenTtl(600)
.withResourcesTtl(90000)
.withResourcesTtl(86400)
.withUserTrackingId('some-user-tracking-id')
.withRequestedTask(
new RequestedTextExtractionTaskBuilder()
.withManualCheckAlways()
.withManualCheckFallback()
.build()
)
// With OrthogonalRestrictionsFilterBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ async function createSession() {

const sessionSpec = new SessionSpecificationBuilder()
.withClientSessionTokenTtl(600)
.withResourcesTtl(90000)
.withResourcesTtl(86400)
.withUserTrackingId('some-user-tracking-id')
.withRequestedCheck(
new RequestedDocumentAuthenticityCheckBuilder()
.withManualCheckAlways()
.withManualCheckFallback()
.build()
)
.withRequestedCheck(
Expand All @@ -33,7 +33,7 @@ async function createSession() {
)
.withRequestedTask(
new RequestedTextExtractionTaskBuilder()
.withManualCheckAlways()
.withManualCheckFallback()
.withChipDataDesired()
.withCreateExpandedDocumentFields(true) // default is false
.build()
Expand All @@ -49,8 +49,8 @@ async function createSession() {
.withSuccessUrl(`${config.YOTI_APP_BASE_URL}/success`)
.withErrorUrl(`${config.YOTI_APP_BASE_URL}/error`)
.withAllowHandoff(true)
.withIdDocumentTextExtractionGenericRetries(5)
.withIdDocumentTextExtractionReclassificationRetries(5)
.withIdDocumentTextExtractionGenericRetries(3)
.withIdDocumentTextExtractionReclassificationRetries(3)
.build()
)
.withRequiredDocument(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ async function createSession() {

const sessionSpec = new SessionSpecificationBuilder()
.withClientSessionTokenTtl(600)
.withResourcesTtl(90000)
.withResourcesTtl(86400)
.withUserTrackingId('some-user-tracking-id')
.withRequestedCheck(
new RequestedIdDocumentComparisonCheckBuilder()
.build()
)
.withRequestedTask(
new RequestedTextExtractionTaskBuilder()
.withManualCheckAlways()
.withManualCheckFallback()
.withChipDataDesired()
.withCreateExpandedDocumentFields(true) // default is false
.build()
)
.withRequestedTask(
new RequestedSupplementaryDocTextExtractionTaskBuilder()
.withManualCheckAlways()
.withManualCheckFallback()
.build()
)
.withRequiredDocument(
Expand Down Expand Up @@ -67,8 +67,8 @@ async function createSession() {
.withPresetIssuingCountry('GBR')
.withSuccessUrl(`${config.YOTI_APP_BASE_URL}/success`)
.withErrorUrl(`${config.YOTI_APP_BASE_URL}/error`)
.withIdDocumentTextExtractionGenericRetries(5)
.withIdDocumentTextExtractionReclassificationRetries(5)
.withIdDocumentTextExtractionGenericRetries(3)
.withIdDocumentTextExtractionReclassificationRetries(3)
.build()
)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,14 @@ async function createSession() {

const sessionSpec = new SessionSpecificationBuilder()
.withClientSessionTokenTtl(600)
.withResourcesTtl(90000)
.withResourcesTtl(86400)
.withUserTrackingId('some-user-tracking-id')
// For zoom liveness check [only one type of liveness check to be enabled at a time]
.withRequestedCheck(new RequestedLivenessCheckBuilder()
.forZoomLiveness()
.build())
// For static liveness check
// .withRequestedCheck(
// new RequestedLivenessCheckBuilder()
// .forStaticLiveness()
// .build()
// )

.withRequestedCheck(
new RequestedLivenessCheckBuilder()
.forStaticLiveness()
.build()
)
.withRequestedCheck(new RequestedFaceComparisonCheckBuilder()
.withManualCheckNever()
.build())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,14 @@ async function createSession() {

const sessionSpec = new SessionSpecificationBuilder()
.withClientSessionTokenTtl(600)
.withResourcesTtl(90000)
.withResourcesTtl(86400)
.withUserTrackingId('some-user-tracking-id')
// For zoom liveness check [only one type of liveness check to be enabled at a time]

.withRequestedCheck(
new RequestedLivenessCheckBuilder()
.forZoomLiveness()
.forStaticLiveness()
.build()
)
// For static liveness check
// .withRequestedCheck(
// new RequestedLivenessCheckBuilder()
// .forStaticLiveness()
// .build()
// )
.withRequestedCheck(
new RequestedFaceMatchCheckBuilder()
.withManualCheckNever()
Expand All @@ -50,8 +44,8 @@ async function createSession() {
.withErrorUrl(`${config.YOTI_APP_BASE_URL}/error`)
.withPrivacyPolicyUrl(`${config.YOTI_APP_BASE_URL}/privacy-policy`)
.withEarlyBiometricConsentFlow() // or withJustInTimeBiometricConsentFlow()
.withIdDocumentTextExtractionGenericRetries(5)
.withIdDocumentTextExtractionReclassificationRetries(5)
.withIdDocumentTextExtractionGenericRetries(3)
.withIdDocumentTextExtractionReclassificationRetries(3)
.build()
)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async function createSession() {

const sessionSpec = new SessionSpecificationBuilder()
.withClientSessionTokenTtl(600)
.withResourcesTtl(90000)
.withResourcesTtl(86400)
.withUserTrackingId('some-user-tracking-id')
.withRequestedCheck(
new RequestedWatchlistScreeningCheckBuilder()
Expand All @@ -75,7 +75,7 @@ async function createSession() {
)
.withRequestedTask(
new RequestedTextExtractionTaskBuilder()
.withManualCheckAlways()
.withManualCheckFallback()
.withChipDataDesired()
.withCreateExpandedDocumentFields(true) // default is false
.build()
Expand All @@ -89,8 +89,8 @@ async function createSession() {
.withPresetIssuingCountry('GBR')
.withSuccessUrl(`${config.YOTI_APP_BASE_URL}/success`)
.withErrorUrl(`${config.YOTI_APP_BASE_URL}/error`)
.withIdDocumentTextExtractionGenericRetries(5)
.withIdDocumentTextExtractionReclassificationRetries(5)
.withIdDocumentTextExtractionGenericRetries(3)
.withIdDocumentTextExtractionReclassificationRetries(3)
.build()
)
.build();
Expand Down

0 comments on commit 4af456d

Please sign in to comment.