How to use yoti - 10 common examples

To help you get started, we’ve selected a few yoti examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github getyoti / yoti-node-sdk / examples / aml-check / aml-usa.js View on Github external
require('dotenv').config();
const fs = require('fs');
const Yoti = require('yoti');

const config = {
  CLIENT_SDK_ID: process.env.YOTI_CLIENT_SDK_ID, // Your Yoti Client SDK ID
  PEM_KEY: fs.readFileSync(process.env.YOTI_KEY_FILE_PATH), // The content of your Yoti .pem key
};

const firstName = 'Edward Richard George';
const lastName = 'Heath';
const countryCode = 'USA';
const postCode = '12345';
const ssn = '123123123';

const yoti = new Yoti.Client(config.CLIENT_SDK_ID, config.PEM_KEY);
const amlAddress = new Yoti.AmlAddress(countryCode, postCode);
const amlProfile = new Yoti.AmlProfile(firstName, lastName, amlAddress, ssn);


yoti.performAmlCheck(amlProfile).then((amlResult) => {
  console.log(`On PEP list: ${amlResult.isOnPepList}`);
  console.log(`On fraud list: ${amlResult.isOnFraudList}`);
  console.log(`On watch list: ${amlResult.isOnWatchList}`);

  console.log('\nAML check result:');
  console.log(amlResult);
}).catch((err) => {
  console.error(err);
});
github getyoti / yoti-node-sdk / examples / aml-check / aml-usa.js View on Github external
const fs = require('fs');
const Yoti = require('yoti');

const config = {
  CLIENT_SDK_ID: process.env.YOTI_CLIENT_SDK_ID, // Your Yoti Client SDK ID
  PEM_KEY: fs.readFileSync(process.env.YOTI_KEY_FILE_PATH), // The content of your Yoti .pem key
};

const firstName = 'Edward Richard George';
const lastName = 'Heath';
const countryCode = 'USA';
const postCode = '12345';
const ssn = '123123123';

const yoti = new Yoti.Client(config.CLIENT_SDK_ID, config.PEM_KEY);
const amlAddress = new Yoti.AmlAddress(countryCode, postCode);
const amlProfile = new Yoti.AmlProfile(firstName, lastName, amlAddress, ssn);


yoti.performAmlCheck(amlProfile).then((amlResult) => {
  console.log(`On PEP list: ${amlResult.isOnPepList}`);
  console.log(`On fraud list: ${amlResult.isOnFraudList}`);
  console.log(`On watch list: ${amlResult.isOnWatchList}`);

  console.log('\nAML check result:');
  console.log(amlResult);
}).catch((err) => {
  console.error(err);
});
github getyoti / yoti-node-sdk / examples / aml-check / aml-usa.js View on Github external
const Yoti = require('yoti');

const config = {
  CLIENT_SDK_ID: process.env.YOTI_CLIENT_SDK_ID, // Your Yoti Client SDK ID
  PEM_KEY: fs.readFileSync(process.env.YOTI_KEY_FILE_PATH), // The content of your Yoti .pem key
};

const firstName = 'Edward Richard George';
const lastName = 'Heath';
const countryCode = 'USA';
const postCode = '12345';
const ssn = '123123123';

const yoti = new Yoti.Client(config.CLIENT_SDK_ID, config.PEM_KEY);
const amlAddress = new Yoti.AmlAddress(countryCode, postCode);
const amlProfile = new Yoti.AmlProfile(firstName, lastName, amlAddress, ssn);


yoti.performAmlCheck(amlProfile).then((amlResult) => {
  console.log(`On PEP list: ${amlResult.isOnPepList}`);
  console.log(`On fraud list: ${amlResult.isOnFraudList}`);
  console.log(`On watch list: ${amlResult.isOnWatchList}`);

  console.log('\nAML check result:');
  console.log(amlResult);
}).catch((err) => {
  console.error(err);
});
github getyoti / yoti-node-sdk / examples / profile / index.js View on Github external
CLIENT_SDK_ID: process.env.YOTI_CLIENT_SDK_ID, // Your Yoti Client SDK ID
  PEM_KEY: fs.readFileSync(process.env.YOTI_KEY_FILE_PATH), // The content of your Yoti .pem key
};

function saveImage(selfie) {
  return new Promise((res, rej) => {
    try {
      fs.writeFileSync(path.join(__dirname, 'static', 'YotiSelfie.jpeg'), selfie.toBase64(), 'base64');
      res();
    } catch (error) {
      rej(error);
    }
  });
}

const yotiClient = new Yoti.Client(config.CLIENT_SDK_ID, config.PEM_KEY);

app.set('view engine', 'ejs');
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use('/static', express.static('static'));

const router = express.Router();

router.get('/', (req, res) => {
  res.render('pages/index', {
    yotiClientSdkId: config.CLIENT_SDK_ID,
    yotiScenarioId: config.SCENARIO_ID,
  });
});

router.get('/dynamic-share', (req, res) => {
github getyoti / yoti-node-sdk / examples / profile / controllers / profile.controller.js View on Github external
const Yoti = require('yoti');
const constants = require('yoti/src/yoti_common/constants');
const config = require('../config');

const yotiClient = new Yoti.Client(config.CLIENT_SDK_ID, config.PEM_KEY);

function createAttributeItem(prop, name, icon) {
  return {
    name,
    icon,
    prop,
  };
}

function buildViewAttributes(profile) {
  const attributes = [];

  profile.getAttributesList().forEach((attribute) => {
    if (attribute.getName().includes(':')) {
      // Derived attributes are handled separately.
      return;
github getyoti / yoti-node-sdk / examples / profile / controllers / profile.controller.js View on Github external
// Derived attributes are handled separately.
      return;
    }

    switch (attribute.getName()) {
      case constants.ATTR_SELFIE:
      case constants.ATTR_FULL_NAME:
        // Handled separately.
        break;
      case constants.ATTR_FAMILY_NAME:
        attributes.push(createAttributeItem(attribute, 'Family names', 'yoti-icon-profile'));
        break;
      case constants.ATTR_GIVEN_NAMES:
        attributes.push(createAttributeItem(attribute, 'Given names', 'yoti-icon-profile'));
        break;
      case constants.ATTR_DATE_OF_BIRTH:
        attributes.push(createAttributeItem(attribute, 'Date of birth', 'yoti-icon-calendar'));
        break;
      case constants.ATTR_GENDER:
        attributes.push(createAttributeItem(attribute, 'Gender', 'yoti-icon-gender'));
        break;
      case constants.ATTR_NATIONALITY:
        attributes.push(createAttributeItem(attribute, 'Nationality', 'yoti-icon-profile'));
        break;
      case constants.ATTR_PHONE_NUMBER:
        attributes.push(createAttributeItem(attribute, 'Mobile number', 'yoti-icon-phone'));
        break;
      case constants.ATTR_EMAIL_ADDRESS:
        attributes.push(createAttributeItem(attribute, 'Email address', 'yoti-icon-email'));
        break;
      case constants.ATTR_POSTAL_ADDRESS:
        attributes.push(createAttributeItem(attribute, 'Address', 'yoti-icon-address'));
github getyoti / yoti-node-sdk / examples / profile / controllers / profile.controller.js View on Github external
profile.getAttributesList().forEach((attribute) => {
    if (attribute.getName().includes(':')) {
      // Derived attributes are handled separately.
      return;
    }

    switch (attribute.getName()) {
      case constants.ATTR_SELFIE:
      case constants.ATTR_FULL_NAME:
        // Handled separately.
        break;
      case constants.ATTR_FAMILY_NAME:
        attributes.push(createAttributeItem(attribute, 'Family names', 'yoti-icon-profile'));
        break;
      case constants.ATTR_GIVEN_NAMES:
        attributes.push(createAttributeItem(attribute, 'Given names', 'yoti-icon-profile'));
        break;
      case constants.ATTR_DATE_OF_BIRTH:
        attributes.push(createAttributeItem(attribute, 'Date of birth', 'yoti-icon-calendar'));
        break;
      case constants.ATTR_GENDER:
        attributes.push(createAttributeItem(attribute, 'Gender', 'yoti-icon-gender'));
        break;
      case constants.ATTR_NATIONALITY:
        attributes.push(createAttributeItem(attribute, 'Nationality', 'yoti-icon-profile'));
        break;
      case constants.ATTR_PHONE_NUMBER:
        attributes.push(createAttributeItem(attribute, 'Mobile number', 'yoti-icon-phone'));
github getyoti / yoti-node-sdk / examples / profile / controllers / profile.controller.js View on Github external
profile.getAttributesList().forEach((attribute) => {
    if (attribute.getName().includes(':')) {
      // Derived attributes are handled separately.
      return;
    }

    switch (attribute.getName()) {
      case constants.ATTR_SELFIE:
      case constants.ATTR_FULL_NAME:
        // Handled separately.
        break;
      case constants.ATTR_FAMILY_NAME:
        attributes.push(createAttributeItem(attribute, 'Family names', 'yoti-icon-profile'));
        break;
      case constants.ATTR_GIVEN_NAMES:
        attributes.push(createAttributeItem(attribute, 'Given names', 'yoti-icon-profile'));
        break;
      case constants.ATTR_DATE_OF_BIRTH:
        attributes.push(createAttributeItem(attribute, 'Date of birth', 'yoti-icon-calendar'));
        break;
      case constants.ATTR_GENDER:
        attributes.push(createAttributeItem(attribute, 'Gender', 'yoti-icon-gender'));
        break;
      case constants.ATTR_NATIONALITY:
        attributes.push(createAttributeItem(attribute, 'Nationality', 'yoti-icon-profile'));
github getyoti / yoti-node-sdk / examples / profile / controllers / profile.controller.js View on Github external
switch (attribute.getName()) {
      case constants.ATTR_SELFIE:
      case constants.ATTR_FULL_NAME:
        // Handled separately.
        break;
      case constants.ATTR_FAMILY_NAME:
        attributes.push(createAttributeItem(attribute, 'Family names', 'yoti-icon-profile'));
        break;
      case constants.ATTR_GIVEN_NAMES:
        attributes.push(createAttributeItem(attribute, 'Given names', 'yoti-icon-profile'));
        break;
      case constants.ATTR_DATE_OF_BIRTH:
        attributes.push(createAttributeItem(attribute, 'Date of birth', 'yoti-icon-calendar'));
        break;
      case constants.ATTR_GENDER:
        attributes.push(createAttributeItem(attribute, 'Gender', 'yoti-icon-gender'));
        break;
      case constants.ATTR_NATIONALITY:
        attributes.push(createAttributeItem(attribute, 'Nationality', 'yoti-icon-profile'));
        break;
      case constants.ATTR_PHONE_NUMBER:
        attributes.push(createAttributeItem(attribute, 'Mobile number', 'yoti-icon-phone'));
        break;
      case constants.ATTR_EMAIL_ADDRESS:
        attributes.push(createAttributeItem(attribute, 'Email address', 'yoti-icon-email'));
        break;
      case constants.ATTR_POSTAL_ADDRESS:
        attributes.push(createAttributeItem(attribute, 'Address', 'yoti-icon-address'));
        break;
      case constants.ATTR_DOCUMENT_DETAILS:
        attributes.push(createAttributeItem(attribute, 'Document Details', 'yoti-icon-profile'));
github getyoti / yoti-node-sdk / examples / profile / controllers / profile.controller.js View on Github external
profile.getAttributesList().forEach((attribute) => {
    if (attribute.getName().includes(':')) {
      // Derived attributes are handled separately.
      return;
    }

    switch (attribute.getName()) {
      case constants.ATTR_SELFIE:
      case constants.ATTR_FULL_NAME:
        // Handled separately.
        break;
      case constants.ATTR_FAMILY_NAME:
        attributes.push(createAttributeItem(attribute, 'Family names', 'yoti-icon-profile'));
        break;
      case constants.ATTR_GIVEN_NAMES:
        attributes.push(createAttributeItem(attribute, 'Given names', 'yoti-icon-profile'));
        break;
      case constants.ATTR_DATE_OF_BIRTH:
        attributes.push(createAttributeItem(attribute, 'Date of birth', 'yoti-icon-calendar'));
        break;
      case constants.ATTR_GENDER:
        attributes.push(createAttributeItem(attribute, 'Gender', 'yoti-icon-gender'));
        break;
      case constants.ATTR_NATIONALITY:
        attributes.push(createAttributeItem(attribute, 'Nationality', 'yoti-icon-profile'));
        break;
      case constants.ATTR_PHONE_NUMBER:
        attributes.push(createAttributeItem(attribute, 'Mobile number', 'yoti-icon-phone'));
        break;
      case constants.ATTR_EMAIL_ADDRESS:
        attributes.push(createAttributeItem(attribute, 'Email address', 'yoti-icon-email'));