Get started with the FoxHat JavaScript SDK today and empower your applications with the security they deserve!
- Browser bot detection
- Headless browser detection
- Incognito detection
- VPN detection
To install the FoxHat JavaScript SDK, run the following command in your terminal:
npm install foxhat-javascript-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);
-
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.
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);
});