Verify should take the data it's verifying as the first argument. In the current construction, it takes it as an argument to the constructor (so you have to construct a new instance for every request, which is cuckoo crazytown bananapants).
As for the callback, it should be changed to take an err, with err being a new Error() with code being the error code, and message being maybe the error code explanation from https://developers.google.com/recaptcha/docs/verify (if recognized)? This way, it would match the async signature of every other function in node
Verify should take the data it's verifying as the first argument. In the current construction, it takes it as an argument to the
constructor
(so you have to construct a new instance for every request, which is cuckoo crazytown bananapants).As for the callback, it should be changed to take an
err
, witherr
being a new Error() withcode
being the error code, andmessage
being maybe the error code explanation from https://developers.google.com/recaptcha/docs/verify (if recognized)? This way, it would match the async signature of every other function in node