essentials-captchadeprecated

Unofficial Essentials Captcha wrapper

Usage no npm install needed!

<script type="module">
  import essentialsCaptcha from 'https://cdn.skypack.dev/essentials-captcha';
</script>

README

Essentials-Captcha

Installation

npm i --save essentials-captcha

Example

const essentials = require('essentials-captcha');

essentials()
.then(captcha => {
    console.log(captcha.url);       // image as url
    console.log(captcha.solution);  // solution as text
})

async function getCaptcha(){
    const captcha = await essentials();
    console.log(captcha.url);
    console.log(captcha.solution);
}

Options

const options = {
    level: 1            // 1 = 'new' generator | 2 = 'old' generator
    style: 'text'       // style of the captcha: 'text' | 'math'
    retry: 0            // times to retry on errors (1 is recommended)
    fetchImage: false   // automatically fetches the image to "Captcha.image"
}
const options = {
    fetchImage: true
}

const captcha = await essentials(options);
console.log(captcha.image);
require('fs').writeFileSync('captcha.png', captcha.image);

Informations

Original Essentials API Repository

API Website

Discord Server