Skip to content

Commit

Permalink
SDK-2179 rename Doc Scan to IDV (#346)
Browse files Browse the repository at this point in the history
* Renamed code reference to Doc Scan to IDV
Name patterns:
- file name: doc.scan.xxx => idv.xxx
- class name: DocScanXxxx => IDVXxxx
- var name: docScanXxxx => idvXxxx

* Updated the examples/doc-scan to examples/idv

* Updated the examples/doc-scan-identity-checks to examples/idv-identity-checks

* Updated the README files.

* Updated Github actions and .travis.yml references to Doc Scan
  • Loading branch information
laurent-yoti committed Sep 14, 2022
1 parent 6673882 commit 9ca2fd6
Show file tree
Hide file tree
Showing 280 changed files with 533 additions and 528 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ jobs:

- run: pushd ./examples/aml-check && npm install && npm update && npm run lint && popd

- run: pushd ./examples/idv && npm install && npm update && npm run lint && popd

- run: pushd ./examples/idv-identity-checks && npm install && npm update && npm run lint && popd

- run: pushd ./examples/profile && npm install && npm update && npm run lint && popd

- run: pushd ./examples/doc-scan && npm install && npm update && npm run lint && popd
- run: pushd ./examples/profile-identity-checks && npm install && npm update && npm run lint && popd

node-compatibility:
name: Node ${{ matrix.node-version }}
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ jobs:
- cd ./examples/profile
- npm update
- npm run lint
- name: Doc Scan
- name: IDV
node_js: "14"
script:
- cd ./examples/doc-scan
- cd ./examples/idv
- npm install
- npm run lint
- <<: *test
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ For each service you will need:

The Yoti SDK can be used for the following products, follow the links for more information about each:
1) [Yoti app integration](/docs/PROFILE.md) - Connect with already-verified customers.
1) [Yoti Doc Scan](/docs/DOCSCAN.md) - Identity verification embedded in your website or app.
1) [Yoti IDV](/docs/IDV.md) - Identity verification embedded in your website or app.

## Support

Expand Down
2 changes: 1 addition & 1 deletion config/yoti.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const constants = require('../src/yoti_common/constants');

const yoti = {
connectApi: process.env.YOTI_CONNECT_API || process.env.YOTI_API_URL || `${constants.API_BASE_URL}/api/v1`,
docScanApi: process.env.YOTI_DOC_SCAN_API || process.env.YOTI_DOC_SCAN_API_URL || `${constants.API_BASE_URL}/idverify/v1`,
idvApi: process.env.YOTI_IDV_API || process.env.YOTI_IDV_API_URL || `${constants.API_BASE_URL}/idverify/v1`,
};

module.exports = yoti;
11 changes: 0 additions & 11 deletions docs/DOCSCAN.md

This file was deleted.

11 changes: 11 additions & 0 deletions docs/IDV.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Yoti IDV

## About

Yoti IDV can be seamlessly integrated with your website, app or custom product, so you can perform secure identity checks. You'll be able to request specific ID documents from users directly from your website or app.

See the [Developer Docs](https://developers.yoti.com/identity-verification/overview) for more information.

## Running the example

- See the [IDV Example](../examples/idv/README.md) folder for instructions on how to run the IDV Example project
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ YOTI_CLIENT_SDK_ID=
YOTI_KEY_FILE_PATH=

# Optional configuration.
YOTI_DOC_SCAN_API_URL=
YOTI_IDV_API_URL=
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Doc Scan Example
# IDV Identity checks Example

## Running the example

Expand All @@ -7,5 +7,5 @@
1. Start the server `npm start`
1. Visit `https://localhost:3003`

* _The [default controller](./src/controllers/index.controller.js) demonstrates how to create a Doc Scan session_
* _The [success controller](./src/controllers/success.controller.js) demonstrates how to retrieve a Doc Scan session_
* _The [default controller](./src/controllers/index.controller.js) demonstrates how to create an IDV session_
* _The [success controller](./src/controllers/success.controller.js) demonstrates how to retrieve an IDV session_
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ const yotiConfig = require('yoti/config').yoti;
module.exports = {
YOTI_CLIENT_SDK_ID: process.env.YOTI_CLIENT_SDK_ID,
YOTI_PEM: fs.readFileSync(process.env.YOTI_KEY_FILE_PATH),
YOTI_DOC_SCAN_IFRAME_URL: `${yotiConfig.docScanApi}/web/index.html`,
YOTI_IDV_IFRAME_URL: `${yotiConfig.idvApi}/web/index.html`,
YOTI_APP_BASE_URL: process.env.YOTI_APP_BASE_URL || 'https://localhost:3003',
};
File renamed without changes.

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-node-sdk-doc-scan-demo",
"description": "A Yoti Doc Scan Demo",
"name": "yoti-node-sdk-idv-identity-checks-demo",
"description": "A Yoti IDV Identity Checks Demo",
"private": true,
"license": "MIT",
"engines": {
Expand All @@ -21,8 +21,8 @@
"devDependencies": {
"eslint": "8.23.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-plugin-jest": "27.0.1",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jest": "27.0.1",
"eslint-plugin-node": "11.1.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
const {
DocScanClient,
IDVClient,
SessionSpecificationBuilder,
SdkConfigBuilder,
} = require('yoti');
const config = require('../../config');

/**
* Create a Doc Scan session.
* Create an IDV session.
*/
async function createSession() {
const docScanClient = new DocScanClient(
const idvClient = new IDVClient(
config.YOTI_CLIENT_SDK_ID,
config.YOTI_PEM
);
Expand Down Expand Up @@ -44,18 +44,18 @@ async function createSession() {
)
.build();

return docScanClient.createSession(sessionSpec);
return idvClient.createSession(sessionSpec);
}

module.exports = async (req, res) => {
try {
const session = await createSession();

req.session.DOC_SCAN_SESSION_ID = session.getSessionId();
req.session.DOC_SCAN_SESSION_TOKEN = session.getClientSessionToken();
req.session.IDV_SESSION_ID = session.getSessionId();
req.session.IDV_SESSION_TOKEN = session.getClientSessionToken();

res.render('pages/index', {
iframeUrl: `${config.YOTI_DOC_SCAN_IFRAME_URL}?sessionID=${req.session.DOC_SCAN_SESSION_ID}&sessionToken=${req.session.DOC_SCAN_SESSION_TOKEN}`,
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 });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
const {
DocScanClient,
IDVClient,
} = require('yoti');
const config = require('../../config');

module.exports = async (req, res) => {
const docScanClient = new DocScanClient(
const idvClient = new IDVClient(
config.YOTI_CLIENT_SDK_ID,
config.YOTI_PEM
);

try {
const media = await docScanClient.getMediaContent(
req.session.DOC_SCAN_SESSION_ID,
const media = await idvClient.getMediaContent(
req.session.IDV_SESSION_ID,
req.query.mediaId
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
const {
DocScanClient,
IDVClient,
} = require('yoti');
const config = require('../../config');

module.exports = async (req, res) => {
const sessionIdFromQuery = req.query && req.query.sessionID;
const sessionId = sessionIdFromQuery || req.session.DOC_SCAN_SESSION_ID;
const docScanClient = new DocScanClient(
const sessionId = sessionIdFromQuery || req.session.IDV_SESSION_ID;
const idvClient = new IDVClient(
config.YOTI_CLIENT_SDK_ID,
config.YOTI_PEM
);

try {
const sessionResult = await docScanClient.getSession(sessionId);
const sessionResult = await idvClient.getSession(sessionId);
res.render('pages/success', { sessionResult });
} catch (error) {
res.render('pages/error', { error });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>

<head>
<title>Yoti Doc Scan</title>
<title>Yoti IDV</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="stylesheet" href="/static/style.css">
Expand All @@ -13,6 +13,6 @@
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top">
<a href="/" class="navbar-brand">
<img src="/static/images/logo.svg" height="30" class="d-inline-block align-top mr-2">
Doc Scan
IDV
</a>
</nav>
</nav>
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ YOTI_CLIENT_SDK_ID=
YOTI_KEY_FILE_PATH=

# Optional configuration.
YOTI_DOC_SCAN_API_URL=
YOTI_IDV_API_URL=
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions examples/doc-scan/README.md → examples/idv/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Doc Scan Example
# IDV Example

## Running the example

Expand All @@ -7,5 +7,5 @@
1. Start the server `npm start`
1. Visit `https://localhost:3000`

* _The [default controller](./src/controllers/index.controller.js) demonstrates how to create a Doc Scan session_
* _The [success controller](./src/controllers/success.controller.js) demonstrates how to retrieve a Doc Scan session_
* _The [default controller](./src/controllers/index.controller.js) demonstrates how to create an IDV session_
* _The [success controller](./src/controllers/success.controller.js) demonstrates how to retrieve an IDV session_
2 changes: 1 addition & 1 deletion examples/doc-scan/config.js → examples/idv/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ const yotiConfig = require('yoti/config').yoti;
module.exports = {
YOTI_CLIENT_SDK_ID: process.env.YOTI_CLIENT_SDK_ID,
YOTI_PEM: fs.readFileSync(process.env.YOTI_KEY_FILE_PATH),
YOTI_DOC_SCAN_IFRAME_URL: `${yotiConfig.docScanApi}/web/index.html`,
YOTI_IDV_IFRAME_URL: `${yotiConfig.idvApi}/web/index.html`,
YOTI_APP_BASE_URL: process.env.YOTI_APP_BASE_URL || 'https://localhost:3000',
};
File renamed without changes.

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-node-sdk-doc-scan-demo",
"description": "A Yoti Doc Scan Demo",
"name": "yoti-node-sdk-idv-demo",
"description": "A Yoti IDV Demo",
"private": true,
"license": "MIT",
"engines": {
Expand All @@ -21,8 +21,8 @@
"devDependencies": {
"eslint": "8.23.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jest": "27.0.1",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-node": "11.1.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const {
DocScanClient,
IDVClient,
SessionSpecificationBuilder,
RequestedDocumentAuthenticityCheckBuilder,
RequestedLivenessCheckBuilder,
Expand All @@ -22,10 +22,10 @@ const {
const config = require('../../config');

/**
* Create a Doc Scan session.
* Create an IDV session.
*/
async function createSession() {
const docScanClient = new DocScanClient(
const idvClient = new IDVClient(
config.YOTI_CLIENT_SDK_ID,
config.YOTI_PEM
);
Expand Down Expand Up @@ -153,18 +153,18 @@ async function createSession() {
)
.build();

return docScanClient.createSession(sessionSpec);
return idvClient.createSession(sessionSpec);
}

module.exports = async (req, res) => {
try {
const session = await createSession();

req.session.DOC_SCAN_SESSION_ID = session.getSessionId();
req.session.DOC_SCAN_SESSION_TOKEN = session.getClientSessionToken();
req.session.IDV_SESSION_ID = session.getSessionId();
req.session.IDV_SESSION_TOKEN = session.getClientSessionToken();

res.render('pages/index', {
iframeUrl: `${config.YOTI_DOC_SCAN_IFRAME_URL}?sessionID=${req.session.DOC_SCAN_SESSION_ID}&sessionToken=${req.session.DOC_SCAN_SESSION_TOKEN}`,
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 });
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
const {
DocScanClient,
IDVClient,
} = require('yoti');
const config = require('../../config');

module.exports = async (req, res) => {
const docScanClient = new DocScanClient(
const idvClient = new IDVClient(
config.YOTI_CLIENT_SDK_ID,
config.YOTI_PEM
);

try {
const media = await docScanClient.getMediaContent(
req.session.DOC_SCAN_SESSION_ID,
const media = await idvClient.getMediaContent(
req.session.IDV_SESSION_ID,
req.query.mediaId
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
const {
DocScanClient,
IDVClient,
} = require('yoti');
const config = require('../../config');

module.exports = async (req, res) => {
const sessionIdFromQuery = req.query && req.query.sessionID;
const sessionId = sessionIdFromQuery || req.session.DOC_SCAN_SESSION_ID;
const docScanClient = new DocScanClient(
const sessionId = sessionIdFromQuery || req.session.IDV_SESSION_ID;
const idvClient = new IDVClient(
config.YOTI_CLIENT_SDK_ID,
config.YOTI_PEM
);

try {
const sessionResult = await docScanClient.getSession(sessionId);
const sessionResult = await idvClient.getSession(sessionId);
res.render('pages/success', { sessionResult });
} catch (error) {
res.render('pages/error', { error });
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 9ca2fd6

Please sign in to comment.