0.0.3 • Published 4 years ago

@variably/uncaptcha-node v0.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

@variably/uncaptcha-node

Official API

  • Package version: 0.0.1

Requirements.

NodeJS 8.11.4+

NodeJS

To install this package you must have NodeJS installed, please follow those instructions for your OS before attempting to use this package.

NPM

Install via NPM (easiest method).

npm install --save @variably/uncaptcha-node

Then import the package:

const uncaptchaNode = require('@variably/uncaptcha-node');

Basic Usage

Please follow the installation procedure and then you may run any of the following:

const uncaptchaNode = require('@variably/uncaptcha-node');

(async() => {
  const api_client = new uncaptchaNode.ApiClient({
    apiTimeout: <Number|Optional|Default:10000>,
    apiUrl: <String|Optional|Default:'https://api.uncaptcha.com'>,

    privateKey: <String|Required>
  });
  const visitorObject = {
    ip: <String|Recommended>,
    'user-agent': <String|Recommended>,
    'uncaptcha-token': <String|Required>
  };
  const verified_response = await api_client.validateUncaptchaResponse(visitorObject);
  if(verified_response && verified_response.body && verified_response.body == 'true'){
    console.log('user verified');
  }else if(verified_response){
    console.log('user failed to verify')
  }else{
    console.log('failed to verify user');
  }
})().catch(console.error);

Documentation For Authorization

All endpoints require authorization.

Author

Variably

0.0.3

4 years ago

0.0.3-0

4 years ago

0.0.2-0

4 years ago

0.0.1

4 years ago