These examples still require the primary snippet be included in your form. Usually, that’s just:


<script src='https://cdn.goodforms.com/verify.js'></script>


This will typically be used when you use the "manual: true" option in your Goodforms initializer, like this:

var my_verifier = Goodforms('form_key', {manual: true});


Verification:


my_verifier.verify("some_email@some_domain",function (results) {
    console.log("Results are: "+results)
});


The result will be a 'data' object, which will include a 'status' - which will be one of 'GOOD', 'BAD', 'CHALLENGE', or 'ERROR'


You will also receive a checksum, which, if you're intending to do Certification on your web application, you should pass along so that the email can be certified as having been verified using GoodForms.


'GOOD' and 'BAD' refer to acceptable and unacceptable emails.


'ERROR' means that something went wrong, either on the server-side, or in JavaScript. You may wish to just allow the user through when this happens, or display a 'something went wrong' message, or whatever works best for you.


For 'CHALLENGE' - if you want to use our Challenge-flow, you should display a prompt to your user, asking them to reconfirm their address. If it matches what they typed in, you should grab the challenge_key element from the verification call, and pass it along to the 'challenge request' using the following:


Challenge:


my_verifier.challenge("some_email@some_domain", challenge_key, function (results) {
    console.log("Results are: "+results)
});


If the challenge is accepted, you should display some kind of dialog that allows the user to type in the PIN that was emailed to them. Confirm whether the PIN was received with the following:


Response:



my_verifier.response("some_email@some_domain", challenge_key, pin, function (results) {
    console.log("Results are: "+results)
});


The results should confirm whether the user was able to pass the challenge successfully. The results should look the save as what you get from a verify() call, including the checksum element.