How to use the yoti.DynamicPolicyBuilder 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 / profile / index.js View on Github external
const constraints = new Yoti.ConstraintsBuilder()
    .withSourceConstraint(sourceConstraint)
    .build();

  const givenNamesWantedAttribute = new Yoti.WantedAttributeBuilder()
    .withName('given_names')
    .withConstraints(constraints)
    .withAcceptSelfAsserted()
    .build();

  const emailAddressWantedAttribute = new Yoti.WantedAttributeBuilder()
    .withName('email_address')
    .build();

  const dynamicPolicy = new Yoti.DynamicPolicyBuilder()
    .withWantedAttribute(givenNamesWantedAttribute)
    .withWantedAttribute(emailAddressWantedAttribute)
    .withFullName(constraints)
    .withSelfie()
    .withPhoneNumber()
    .withAgeOver(18)
    .build();

  const dynamicScenario = new Yoti.DynamicScenarioBuilder()
    .withCallbackEndpoint('/profile')
    .withPolicy(dynamicPolicy)
    .withExtension(locationExtension)
    .build();

  yotiClient.createShareUrl(dynamicScenario)
    .then((shareUrlResult) => {
github getyoti / yoti-node-sdk / examples / profile / index.js View on Github external
router.get('/dynamic-share', (req, res) => {
  const dynamicPolicy = new Yoti.DynamicPolicyBuilder()
    .withFullName()
    .build();

  const dynamicScenario = new Yoti.DynamicScenarioBuilder()
    .withCallbackEndpoint('/profile')
    .withPolicy(dynamicPolicy)
    .build();

  yotiClient.createShareUrl(dynamicScenario)
    .then((shareUrlResult) => {
      const qrUrl = shareUrlResult.getShareUrl();
      res.render('pages/dynamic-share', {
        yotiApplicationId: config.APPLICATION_ID,
        yotiScenarioId: config.SCENARIO_ID,
        yotiQrUrl: qrUrl,
      });