@botprotect/botprotect

BotProtect API

Usage no npm install needed!

<script type="module">
  import botprotectBotprotect from 'https://cdn.skypack.dev/@botprotect/botprotect';
</script>

README

BotProtect API

JavaScript API for BotProtect APIv1

Installation

$ npm install botprotect

Usage

You must be a registered client to use this API. Please request a demo on our website. Already registered? Here is how you use it!

To initiate the library:

const { BotProtectApi } = require('botprotect');

const BotProtect = new BotProtectApi({
    publicKey: 'YOUR_PUBLIC_KEY', // String
    privateKey: 'YOUR_PRIVATE_KEY', // String
    showFingerprint: true // Boolean
});

To verify user token:

Examples

ASYNC

(async () => {
    let res = await BotProtect.verify('USER_TOKEN');
    console.log(res);
})();

SYNC

BotProtect.verify('USER_TOKEN', (res) => {
    console.log(res);
});

RETURN


{
    "human": BOOLEAN,
    "clientIp": STRING,
    "isRdp": BOOLEAN,
    "isVNCServer": BOOLEAN,
    "solveTime": INT,
    "userAgent": STRING,
    "deviceBrowserFingerprint": STRING
}

Learn more on our api page.