How to use the yoti.AmlProfile 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
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);
});