Castle Fingerprinting Script
Packaged version of Castle fingerprinting script.
Introduction
The Castle JavaScript automatically captures every user action in your web application, including clicks, taps, swipes, form submissions, and page views. We use this data to build profiles of good user behavior in order to detect the bad.
Installation
npm install --save @castleio/castle-js
yarn add @castleio/castle-js
Configuration
Basic configuration of the app
import * as Castle from '@castleio/castle-js'
Castle.configure(YOUR_CASTLE_APP_ID);
Advanced configuration of the app
import * as Castle from '@castleio/castle-js'
Castle.configure(appId, options);
Usage
Getting castle request token
import * as Castle from '@castleio/castle-js'
Castle.createRequestToken().then( (requestToken) => {
....
});
const requestToken = await Castle.createRequestToken();
See Castle Docs for more information and how to pass the token further.
browser version
If your environment does not support modules you can use the browser version
import '@castleio/castle-js/dist/castle.browser.js'
_castle('setAppId', YOUR_CASTLE_APP_ID);
_castle('createRequestToken').then( (requestToken) => {
....
});
Upgrade from 1.x script
Before
_castle('getClientId')
After
Castle.createRequestToken().then( (requestToken) => {
});
// or
const token = await Castle.createRequestToken();
No longer available commands for _castle(...)
:
`autoForwardClientId`, 'autoTrack', `catchHistoryErrors`, `identify`, `setUserId`, `setAccount`, `setKey`, `setAccount`, `sessionId`, `reset`, `page`, `trackPageView`, `setTrackerUrl`
Request Token is now required to be passed in the request params and it is no longer available in the cookie. Check the docs
Changelog
- 2.0.0 – migration from 1.x, modularization, updated DSL
Minimal Requirements:
ES3+ version supported browsers eg:
License
MIT