const CryptoJS = require("crypto-js");
const {FoxHat} = require("foxhat-node-sdk");
const apiKay = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcGlfdXJsIjoiaHR0cHM6L...."
const foxhat = new FoxHat(apiKay);
const password = "user_password"
const hashedPassword = CryptoJS.SHA256(password).toString();
foxhat.compromised('email', hashedPassword, (error, isCompromised, data) => {
if (error) {
console.error('Error:', error.message);
} else {
if (isCompromised === true) {
console.log('Credentials are compromised');
}
else {
console.log('Credentials are not compromised');
}
}
});