npm.io
0.0.101 • Published 1 year ago

foxhat-javascript-sdk

Licence
Version
0.0.101
Deps
4
Size
1.4 MB
Vulns
0
Weekly
0

Integrating FoxHat JavaScript

Introduction

Get started with the FoxHat JavaScript SDK today and empower your applications with the security they deserve!

Features

  • Browser bot detection
  • Headless browser detection
  • Incognito detection
  • VPN detection

Installation

To install the FoxHat JavaScript SDK, run the following command in your terminal:

npm install foxhat-javascript-sdk

Usage

Initializing the SDK

To use the FoxHat SDK, you need to create an instance of the FoxHat class. Provide your API key when initializing:

const foxtHatInstance = new FoxHat.FoxHat(apiKey, true);
Parameters:
  • apiKey: Your unique API key provided by FoxHat, required for SDK initialization.
  • debugMode: The second parameter (true) enables debug mode, which can be helpful during development.
Getting a Token

Once the SDK is initialized, you can retrieve a security token necessary for making authorized API requests. Here's how to obtain and display the token:

foxtHatInstance.token()
    .then(result => {
        console.log(result)
    })
    .catch(error => {
        console.error('Error fetching token:', error);
    });