How to use the yoti.Client function in yoti

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 / 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 / index.js View on Github external
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', {
    yotiApplicationId: config.APPLICATION_ID,
    yotiScenarioId: config.SCENARIO_ID,
  });
});

router.get('/dynamic-share', (req, res) => {