example.js
function validateCaptcha(captchaKey, captchaValue, callback) {

  // callback = function(err, isValid) {...}
  sweetcaptcha.api('check', {sckey: captchaKey, scvalue: captchaValue}, function(err, response){
    if (err) return callback(err);

    if (response === 'true') {
      // valid captcha
      return callback(null, true); 
    }

    // invalid captcha
    callback(null, false);

  });
  
}
function validateCaptcha(captchaKey, captchaValue, callback) {

  // callback = function(err, isValid) {...}
  sweetcaptcha.api('check', {sckey: captchaKey, scvalue: captchaValue}, function(err, response){
    if (err) return callback(err);

    if (response === 'true') {
      // valid captcha
      return callback(null, true); 
    }

    // invalid captcha
    callback(null, false);

  });
  
}
function validateCaptcha ( captchaKey , captchaValue , callback ) { // callback = function(err, isValid) {...} sweetcaptcha . api ( 'check' , { sckey : captchaKey , scvalue : captchaValue } , function ( err , response ) { if ( err ) return callback ( err ) ; if ( response === 'true' ) { // valid captcha return callback ( null , true ) ; } // invalid captcha callback ( null , false ) ; } ) ; }
Validate using sckey and scvalue, hidden inputs from previous HTML
Validate using sckey and scvalue hidden inputs from previous HTML