-
Notifications
You must be signed in to change notification settings - Fork 17
Release/4.12.0 #539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release/4.12.0 #539
Changes from 4 commits
97e8ee0
042e9de
1085653
093c613
6668464
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| const { | ||
| IDVClient, | ||
| SessionSpecificationBuilder, | ||
| SdkConfigBuilder, | ||
| RequiredIdDocumentBuilder, | ||
| RequestedDocumentAuthenticityCheckBuilder, | ||
| RequestedTextExtractionTaskBuilder, | ||
| } = 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 sessionSpec = new SessionSpecificationBuilder() | ||
| .withClientSessionTokenTtl(600) // 10 minutes | ||
| .withResourcesTtl(90000) // session TTL(10 minutes) + 24 hours(minimum required) | ||
| .withUserTrackingId('some-user-tracking-id') | ||
| .withRequestedCheck( | ||
| new RequestedDocumentAuthenticityCheckBuilder() | ||
| .withManualCheckFallback() | ||
| .build() | ||
| ) | ||
| .withRequestedTask( | ||
| new RequestedTextExtractionTaskBuilder() | ||
| .withManualCheckFallback() | ||
| .withChipDataDesired() | ||
| .withCreateExpandedDocumentFields(true) // default is false | ||
| .build() | ||
| ) | ||
| .withSdkConfig( | ||
| new SdkConfigBuilder() | ||
| .withAllowsCameraAndUpload() | ||
| .withPrimaryColour('#2d9fff') | ||
| .withSecondaryColour('#FFFFFF') | ||
| .withFontColour('#FFFFFF') | ||
| .withLocale('en-GB') | ||
| .withPresetIssuingCountry('GBR') | ||
| .withSuccessUrl(`${config.YOTI_APP_BASE_URL}/success`) | ||
| .withErrorUrl(`${config.YOTI_APP_BASE_URL}/error`) | ||
| .withAllowHandoff(true) | ||
| .withIdDocumentTextExtractionGenericRetries(3) | ||
| .withIdDocumentTextExtractionReclassificationRetries(3) | ||
| .withSuppressedScreens([ | ||
| 'ID_DOCUMENT_EDUCATION', | ||
| 'ID_DOCUMENT_REQUIREMENTS', | ||
| ]) | ||
| .build() | ||
| ) | ||
| .withRequiredDocument( | ||
| (new RequiredIdDocumentBuilder()).build() | ||
| ) | ||
| .build(); | ||
|
|
||
| return idvClient.createSession(sessionSpec); | ||
| } | ||
|
|
||
| module.exports = async (req, res) => { | ||
| try { | ||
| const session = await createSession(); | ||
|
|
||
| req.session.IDV_SESSION_ID = session.getSessionId(); | ||
| req.session.IDV_SESSION_TOKEN = session.getClientSessionToken(); | ||
|
|
||
| res.render('pages/session', { | ||
| sessionId: req.session.IDV_SESSION_ID, | ||
| 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 }); | ||
| } | ||
| }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name": "yoti", | ||
| "version": "4.11.1", | ||
| "version": "4.12.0", | ||
| "description": "Yoti NodeJS SDK for back-end integration", | ||
| "author": "Yoti LTD <[email protected]> (https://www.yoti.com/developers)", | ||
| "license": "MIT", | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.