What is @fingerprintjs/fingerprintjs?
@fingerprintjs/fingerprintjs is a JavaScript library that provides a way to uniquely identify users based on their browser and device characteristics. It is commonly used for fraud prevention, user authentication, and personalization.
What are @fingerprintjs/fingerprintjs's main functionalities?
Generate a Visitor Identifier
This feature allows you to generate a unique identifier for a visitor based on their browser and device characteristics. The code sample demonstrates how to load the FingerprintJS library, generate a visitor identifier, and log it to the console.
const FingerprintJS = require('@fingerprintjs/fingerprintjs');
FingerprintJS.load().then(fp => {
fp.get().then(result => {
const visitorId = result.visitorId;
console.log(visitorId);
});
});
Get Detailed Visitor Data
This feature provides detailed information about the visitor's browser and device characteristics. The code sample shows how to access and log the detailed components of the visitor's fingerprint.
const FingerprintJS = require('@fingerprintjs/fingerprintjs');
FingerprintJS.load().then(fp => {
fp.get().then(result => {
const components = result.components;
console.log(components);
});
});
Other packages similar to @fingerprintjs/fingerprintjs
clientjs
ClientJS is a JavaScript library for generating a client-side fingerprint based on browser and device characteristics. It offers similar functionality to @fingerprintjs/fingerprintjs but may not be as comprehensive in terms of the data it collects and analyzes.
fingerprintjs2
FingerprintJS2 is an older version of the FingerprintJS library. It provides similar functionality for generating unique visitor identifiers but lacks some of the newer features and improvements found in @fingerprintjs/fingerprintjs.
ua-parser-js
UA-Parser-JS is a JavaScript library for parsing user-agent strings to identify browser, engine, OS, CPU, and device type/model. While it does not generate a unique visitor identifier, it provides detailed information about the user's environment, which can be used in conjunction with other libraries for fingerprinting.
FingerprintJS is a browser fingerprinting library that queries browser attributes and computes a hashed visitor identifier from them. Unlike cookies and local storage, a fingerprint stays the same in incognito/private mode and even when browser data is purged.
View Our Demo.
Quick start
Install from CDN
<script>
function initFingerprintJS() {
const fpPromise = FingerprintJS.load()
fpPromise
.then(fp => fp.get())
.then(result => {
const visitorId = result.visitorId
console.log(visitorId)
})
}
</script>
<script
async
src="//cdn.jsdelivr.net/npm/@fingerprintjs/fingerprintjs@3/dist/fp.min.js"
onload="initFingerprintJS()"
></script>
Run this code
Alternatively you can install from NPM to use with Webpack/Rollup/Browserify
npm i @fingerprintjs/fingerprintjs
yarn add @fingerprintjs/fingerprintjs
import FingerprintJS from '@fingerprintjs/fingerprintjs'
const fpPromise = FingerprintJS.load()
;(async () => {
const fp = await fpPromise
const result = await fp.get()
const visitorId = result.visitorId
console.log(visitorId)
})()
Run this code
📕 Full documentation
Switch to Pro version for free to get 99.5% identification accuracy
FingerprintJS Pro is a professional visitor identification service that processes all information server-side and transmits it securely to your servers using server-to-server APIs.
Pro combines browser fingerprinting with vast amounts of auxiliary data (IP addresses, time of visit patterns, URL changes and more) to be able to reliably deduplicate different users that have identical devices, resulting in 99.5% identification accuracy.
You can use Pro FREE for up to 1,000 unique monthly visitors - no credit card required.
Full product comparison:
| Open Source | Pro |
---|
Core Features |
100% Open-source | yes | no* |
Standard fingerprint signals screen, os, device name | ✓ | ✓ |
Advanced fingerprint signals canvas, audio, fonts | ✓ | ✓ |
ID type | fingerprint | visitorID** |
ID lifetime | several weeks | months/years |
ID origin | client | server |
ID collisions | common | rare |
Additional Features |
Incognito mode detection works in all modern browsers - see our full list of browsers supported | – | ✓ |
Server-side accuracy increase based on additional server-side signals, such as TLS crypto support, ipv4/v6 data and others | – | ✓ |
Query API & realtime Webhooks build flexible workflows | – | ✓ |
Geolocation based on IP address | – | ✓ |
Operations |
Data security | Your infrastructure | Encrypted at rest |
Storage | Your infrastructure | Unlimited up to 1 yr |
Regions | Your infrastructure | Hosting in US and EU |
Compliance | Your infrastructure | GDPR, CCPA compliant*** |
SLA | No SLA | 99.9% Uptime |
Support | GitHub community | Support team via email, chat, and call-back within 1 business day |
* Pro uses the open source fingerprinting library as well as proprietary technology for increased accuracy and stability.
** VisitorIDs, in comparison to fingerprints, include server side techniques, are deduplicated and utilize fuzzy matching to result in a more accurate and stable identifier. Fingerprint hashes rely on an exact match across all browser attributes, making them unstable across > 2 week time intervals.
*** FingerprintJS is GDPR and CCPA compliant as the data processor. You still need to be compliant as the data controller and use the identification for fraud under legitimate interest or ask for user consent.
Pro result example:
{
"requestId": "HFMlljrzKEiZmhUNDx7Z",
"visitorId": "kHqPGWS1Mj18sZFsP8Wl",
"visitorFound": true,
"incognito": false,
"browserName": "Chrome",
"browserVersion": "85.0.4183",
"os": "Mac OS X",
"osVersion": "10.15.6",
"device": "Other",
"ip": "192.65.67.131",
"ipLocation": {
"accuracyRadius": 100,
"latitude": 37.409657,
"longitude": -121.965467
}
}
🍿 Live demo
⏱ How to upgrade from Open Source to Pro in 30 seconds
📕 FingerprintJS Pro documentation
▶️ Video: use FingerprintJS Pro to prevent multiple signups
Migrating from v2
Version policy
See the compatibility policy for the API and visitor identifiers in the version policy guide.
Browser support
The library supports all popular browsers.
See more details and learn how to run the library in old browsers in the browser support guide.
Contributing
See the contributing guidelines to learn how to start a playground, test and build.