PasswordPing JavaScript Client Library
TOC
This README covers the following topics:
Installation
$ npm install passwordping
API Overview
Below is some simple example code which demonstrates the usage of the API.
var PasswordPing = ; // Create a new PasswordPing instance - this is our primary interface for making API callsvar passwordping = YOUR_API_KEY YOUR_API_SECRET; // Check whether a password has been compromisedpasswordping; // Check whether a specific set of credentials are compromisedpasswordping; // Enhanced version of checkCredentials offering more control over performance.// The call introduces an options object parameter, which supports the following settings://// lastCheckDate: // The timestamp for the last check you performed for this user.// If the date/time you provide for the last check is greater than the timestamp PasswordPing has for the last// breach affecting this user, the check will not be performed. This can be used to substantially increase performance.//// excludeHashAlgorithms: // An array of PasswordTypes to ignore when calculating hashes for the credentials check. // By excluding computationally expensive PasswordTypes, such as BCrypt, it is possible to balance the performance of this// call against security.//passwordping; // get all exposures for the given userpasswordping; // get all exposures for a given domain - second parameter indicates whether to include exposure details in resultspasswordping; // get all users exposed for a given domain// returns paged results per https://www.passwordping.com/docs-exposures-api/#get-exposed-users-for-domainpasswordping; // SHA256 hashes of a couple of email addressesvar arrUsernameSHA256Hashes = 'd56cdba2a920248f6487eb5a951013fcb9e4752a2ba5f1fa61ef8d235c44351e' '006ddca2a920248f6487eb5a951013fcb9e4752a2ba5f1fa61ef8d235c44356e'; // subscribe for alerts for these userspasswordping; // delete subscriptions for these userspasswordping; // check whether a user is already subscribedpasswordping; // get all users subscribed for alerts on this account // returns paged results per https://www.passwordping.com/docs-exposure-alerts-service-api/#get-exposure-subscriptionspasswordping; // test domains for alert subscriptionsvar arrDomains = 'testdomain1.com' 'testdomain2.com' ; // subscribe for alerts for these domainspasswordping; // delete subscriptions for these domainspasswordping; // check whether a domain is already subscribedpasswordping; // get all users subscribed for alerts on this account // returns pages results per https://www.passwordping.com/docs-exposure-alerts-service-api/#get-exposure-subscriptions-domainspasswordping;
More information in reference format can be found below.
The PasswordPing constructor
The standard constructor takes the API key and secret you were issued on PasswordPing signup.
var passwordping = YOUR_API_KEY YOUR_API_SECRET;
If you were instructed to use an alternate API host, you may call the overloaded constructor and pass the host you were provided.
var passwordping = YOUR_API_KEY YOUR_API_SECRET "api-alt.passwordping.com";