Skip to content

Commit

Permalink
update example configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilPank authored and laurent-yoti committed Jan 2, 2024
1 parent 965fa43 commit 365a4b9
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 57 deletions.
31 changes: 14 additions & 17 deletions examples/idv-identity-checks/src/controllers/index.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,38 @@ const {
IDVClient,
SessionSpecificationBuilder,
SdkConfigBuilder,
} = require('yoti');
const config = require('../../config');
} = require("yoti");
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',
subject_id: "subject_id_string",
};

const identityProfileRequirements = {
trust_framework: 'UK_TFIDA',
trust_framework: "UK_TFIDA",
scheme: {
type: 'DBS',
objective: 'BASIC',
type: "DBS",
objective: "BASIC",
},
};

const sessionSpec = new SessionSpecificationBuilder()
.withClientSessionTokenTtl(600)
.withResourcesTtl(90000)
.withUserTrackingId('some-user-tracking-id')
.withResourcesTtl(86400)
.withUserTrackingId("some-user-tracking-id")
.withSubject(subject)
.withIdentityProfileRequirements(identityProfileRequirements)
.withSdkConfig(
new SdkConfigBuilder()
.withPrimaryColour('#2d9fff')
.withLocale('en-GB')
.withPresetIssuingCountry('GBR')
.withPrimaryColour("#2d9fff")
.withLocale("en-GB")
.withPresetIssuingCountry("GBR")
.withSuccessUrl(`${config.YOTI_APP_BASE_URL}/success`)
.withErrorUrl(`${config.YOTI_APP_BASE_URL}/error`)
.withAllowHandoff(true)
Expand All @@ -54,10 +51,10 @@ module.exports = async (req, res) => {
req.session.IDV_SESSION_ID = session.getSessionId();
req.session.IDV_SESSION_TOKEN = session.getClientSessionToken();

res.render('pages/index', {
res.render("pages/index", {
iframeUrl: `${config.YOTI_IDV_IFRAME_URL}?sessionID=${req.session.IDV_SESSION_ID}&sessionToken=${req.session.IDV_SESSION_TOKEN}`,
});
} catch (error) {
res.render('pages/error', { error });
res.render("pages/error", { error });
}
};
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 365a4b9

Please sign in to comment.