@adcaptcha/node
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

adCAPTCHA Node

This package provides a Node component for adCAPTCHA. The verify component is used to verify a success token which is exposed after a successful completion of a captcha.

Installation

npm install @adcaptcha/node

Usage

API Key

The API Key is your secret key that you will need for the verification step to work. To obtain your API Key, you will need to generate one from the AdCAPTCHA dashboard.

Documentation to learn how to create an API Key.

Token

The token is exposed when the captcha has successfully been solved. Example how to get the success token.

import { verify } from '@adcaptcha/node';

const apiKey = "secret_key"; // Do not store in your code, should be kept secret (e.g. environment variables).
const token = "captcha_success_token";

try {
  const response = await verify(apiKey, token)
} catch (error) {
  console.log(error)
  return;
}

Response from verify

Status Code Message
200 Token verified
400 Token missing
400 Invalid token
400 Token already verified

Readme

Keywords

Package Sidebar

Install

npm i @adcaptcha/node

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

6.23 kB

Total Files

6

Last publish

Collaborators

  • adcapctha-orssich
  • lucas_adcaptcha
  • mattgibney