The library is shipped in various formats:
<script>
function initFingerprintJS() {
// Start loading FingerprintJS here
}
</script>
<script
async
src="//cdn.jsdelivr.net/npm/@fingerprintjs/fingerprintjs@3/dist/fp.min.js"
onload="initFingerprintJS()"
></script>
require(
['//cdn.jsdelivr.net/npm/@fingerprintjs/fingerprintjs@3/dist/fp.umd.min.js'],
(FingerprintJS) => {
// Start loading FingerprintJS here
}
)
# Install the package first:
npm i @fingerprintjs/fingerprintjs
# or
yarn add @fingerprintjs/fingerprintjs
import FingerprintJS from '@fingerprintjs/fingerprintjs'
// Start loading FingerprintJS here
# Install the package first:
npm i @fingerprintjs/fingerprintjs
# or
yarn add @fingerprintjs/fingerprintjs
const FingerprintJS = require('@fingerprintjs/fingerprintjs')
// Start loading FingerprintJS here
Builds an instance of Agent and waits a delay required for a proper operation.
We recommend calling it as soon as possible.
delayFallback
is an optional parameter that sets duration (milliseconds) of the fallback for browsers that don't support requestIdleCallback;
it has a good default value which we don't recommend to change.
A method of an Agent instance that gets the visitor identifier.
We recommend calling it later, when you really need the identifier, to increase the chance of getting an accurate identifier.
debug: true
prints debug messages to the console.
Result object fields:
visitorId
The visitor identifiercomponents
A dictionary of components that have formed the identifier. Each value is an object like{ value: any, duration: number }
in case of success and{ error: object, duration: number }
in case of an unexpected error during getting the component.version
The fingerprinting algorithm version which is equal to the library version. See the version policy section for more details.
See the extending guide to learn how to remove and add entropy components.
Converts a dictionary of components (described above) into a short hash string a.k.a. a visitor identifier. Designed for extending the library with your own components.
Converts a dictionary of components (described above) into human-friendly format.