Checkr.js makes it easy to collect sensitive personal data without having the information touch your server.
<script type="text/javascript" src="https://js.checkr.com/checkr-2.0.0.min.js"></script>
You have to set your publishable key so that Checkr can identify your website. You can retrieve your publishable key for test and production in your dashboard.
Checkr.setPublishableKey('YOUR_KEY_HERE');
var candidateData = {
first_name: 'John',
middle_name: 'Peter',
last_name: 'Smith',
ssn: '111-11-1111',
email: '[email protected]',
phone: '(310) 111-1111',
dob: '10/02/1987'
};
Checkr.candidate.create(candidateData, function (status, response) {
console.log("status: " + status);
if (response.error) {
var errorMessage = response.error;
console.log(errorMessage);
// your logic
} else {
var candidate_id = response.candidate_id;
// your logic
}
});
Checks whether or not an SSN is valid
Checkr.candidate.isSSNValid("111-11-1111") // true
Checkr.candidate.isSSNValid("111-1111-1111") // false
Checks whether or not an email is valid
Checkr.candidate.isEmailValid("[email protected]") // true
Checkr.candidate.isEmailValid("john.com") // false
Checks whether or not a phone number is valid
Checkr.candidate.isPhoneValid("3101111111") // true
Checkr.candidate.isPhoneValid("31011111") // false