foxhat-javascript-sdk
v0.0.101
Published
Official SDK for FoxHat Plaform APIs
Readme
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-sdkUsage
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);
});