docs/examples/solve-recaptcha-v2.js
function handler (options, { captcha }) {
  return new Promise((resolve, reject) => {
    // Here you do some magic with the siteKey provided by cloudscraper
    console.error('The url is "' + captcha.url + '"');
    console.error('The site key is "' + captcha.siteKey + '"');
    // captcha.form['g-recaptcha-response'] = /* Obtain from your service */
    reject(new Error('This is a dummy function.'));
  });
}
function handler (options, { captcha }) {
  return new Promise((resolve, reject) => {
    // Here you do some magic with the siteKey provided by cloudscraper
    console.error('The url is "' + captcha.url + '"');
    console.error('The site key is "' + captcha.siteKey + '"');
    // captcha.form['g-recaptcha-response'] = /* Obtain from your service */
    reject(new Error('This is a dummy function.'));
  });
}
Pseudo function that returns a promise instead of calling captcha.submit()