npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@vonage/fraud-protection-library

v0.1.0

Published

A wrapper around various fraud prevention libraries provided by Vonage in one package. Add a variety of steps to gauge the potential fraud based on a device or telephone number, and build business rules around handling the results. Information can easily

Downloads

17

Readme

Vonage Fraud Prevention Library

A wrapper around various fraud prevention libraries provided by Vonage in one package. Add a variety of steps to gauge the potential fraud based on a device or telephone number, and build business rules around handling the results. Information can easily be fed into automated systems to provide real-time alerting and blocking.

Installation

Requirements

  • Node.js 18+
  • A Vonage Developer Account
  • Some modules may require additional account settings, contact Support for more information:
    • Fraud Defender Decision API
    • Silent Authentication

Install Package

You can include the library in your application by installing it through NPM:

npm install @vonage/fraud-protection-library

Usage

The Vonage Fraud Protection Library is a wrapper for the Vonage Node SDK that will automatically set up and process data through a workflow specified by the developer. You will create a new instance of our Fraud Protection library with your Vonage credentials, add in the products you want to use as part of the Fraud Protection workflow, and then run any data you have the workflows.

const client = new fraudProtection({
    apiKey: '<vonage-api-key>',
    apiSecret: '<vonage-api-secret>',
    applicationId: '<vonage-application-id>',
    privateKey: '<vonage-private-key>'
});

// Add the products you want to run through
client.add(new FraudDefenderDecision())
client.add(new TFA({ sendPin: true }))

// Keep track of workflow with a "context"
const existingContext = req.session.context || {};
// Pass data into the library for us to check against
const data = req.session.data || {phone: '14199802340', to: '18003819125'};

// Run the data through the services and get a result
const context = await client.run(data, existingContext);

The client.run() method will return a "context", which is a result of the workflow runs. This context can be saved off for later, or even augmented with additional info to be re-run (for example, the first run may fail Verify due to a missing PIN, but a second run can be done adding in the PIN to check).

{
  success: false,
  results: [
    {
      stageName: 'frauddefenderdecision',
      success: true,
      message: undefined,
      stage: 0
    },
    { stageName: 'simSwap', success: true, message: null, stage: 1 },
    {
      stageName: 'tfa',
      success: false,
      message: 'No Request ID',
      requestId: 'a0b7faa7-8077-4593-816d-xxxxxxxxxxxx',
      stage: 2
    }
  ]
}

Your application can check context.success for an overall pass/fail, or dive into any stage to make individual decisions.