@evokegroup/recaptcha
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@evokegroup/recaptcha

Utility class for verifying reCAPTCHA challenges

Class: Recaptcha

Static Methods

Recaptcha.verify(secret, response) ⇒ Promise<Recaptcha.Response>

Verifies the reCAPTCHA challenge response using the secret key

Parameter Type Description
secret string The reCAPTCHA secret key
response string The reCAPTCHA challenge response

Usage

const Recaptcha = require('@evokegroup/recaptcha');

Recaptcha.verify('mysecret', 'challengeResponse')
.then((response) => {
  if (response.success) {
    // Do something
  } else {
    // Invalid
  }
})
.catch((ex) => {
  console.log(ex);
});

Class: Recaptcha.Response

constructor(webRequestResponse)

Properties

Property Type Description
success boolean Indicates if the challenge response was valid
result object The result object returned from the reCAPTCHA API call
response object The web request response object
exception Error Any exception that occurred

Readme

Keywords

none

Package Sidebar

Install

npm i @evokegroup/recaptcha

Weekly Downloads

2

Version

2.0.0

License

ISC

Unpacked Size

4.45 kB

Total Files

5

Last publish

Collaborators

  • ybevoke
  • jtsuyuki
  • evokejames
  • evoke-cjamodeo