Introducing the User Identification Library - FingerprintJS

Introducing the User Identification Library - FingerprintJS

Daily short news for you
  • openai/codex is the latest open-source project from OpenAI, following their announcement of the two newest models, o3 and o4 mini. It is said that both o3 and o4 mini are very suitable for being Agents, so they released Codex as a lightweight Agent that runs directly in the Terminal.

    Regarding its applicability, since it is an Agent, it can read/add/edit/delete the contents of your files. For example.

    codex "explain this codebase to me"

    Or integrate it into your CI/CD pipeline.

    - name: Update changelog via Codex run: | npm install -g @openai/codex export OPENAI_API_KEY="${{ secrets.OPENAI_KEY }}" codex -a auto-edit --quiet "update CHANGELOG for next release"

    Oh, I almost forgot, you need to use the OpenAI API 😆

    » Read more
  • Perhaps many people do not know that OpenAI has launched its own academy page to help users learn and fully harness the power of their language models.

    OpenAI Academy

    » Read more
  • Mornings have started with some sensational news: OpenAI wants to acquire Windsurf for $3 billion 😳

    » Read more

Problem

We always want to know how many people are using our website, track visits, or identify unique users.

One simple way to do that is to require users to log in, which allows us to easily capture sessions through the user ID stored in the system. This method works well, but it's not always possible to get users to log in. Therefore, we need to find an alternative solution to identify users.

What is FingerprintJS

FingerprintJS is a library that provides the most accurate device identification for mobile and web devices. FingerprintJS supports cross-platform identification from Android, iOS to web browsers.

We know that the browser acts as a bridge for users to access websites. The browser itself contains a lot of information about itself as well as user information, such as browser type, version, display size, operating system, IP address, and much more. Visit https://coveryourtracks.eff.org to learn more about the information that browsers can "fetch" from you. This information, if successfully exploited and processed, can provide a unique identification for the user currently using it.

We may have encountered the need to identify users without using the login feature. Therefore, we need a way to mark whether a user has used the application before or not. A simple method is to generate a random identification string and store it in the cache. This method is quick and easy, but if the cache is cleared, everything will start from scratch. Therefore, we need a better user identification solution.

You can create your own algorithm to generate identification based on the data collected from the browser, or you can use the FingerprintJS library to do so. FingerprintJS has two versions: Open Source and Pro. According to their claims, the Open Source version has an accuracy of up to 60%, while the Pro version has an accuracy of up to 99.5%. However, when using the Pro version, you need to make requests to FingerprintJS's server to perform the identification process and there is a limit of 20,000 requests per month. If you exceed this limit, you will need to pay extra to use the service.

FingerprintJS will calculate based on the collected data to generate a user identification string like this:

x6e9RzbUC2P96yckcMih

How to Use

FingerprintJS provides various ways to use it.

Using a CDN:

  const fpPromise = import('https://openfpcdn.io/fingerprintjs/v3')
    .then(FingerprintJS => FingerprintJS.load())

  fpPromise
    .then(fp => fp.get())
    .then(result => console.log(result.visitorId))

Or through npm:

npm i @fingerprintjs/fingerprintjs
import FingerprintJS from '@fingerprintjs/fingerprintjs'

const fpPromise = FingerprintJS.load();

(async () => {
  const fp = await fpPromise
  const result = await fp.get()
  console.log(result.visitorId)
})()

To use the Pro version, you need to sign up for an account on FingerprintJS, and the system will display the tracking code to be added to your website.

FingerprintJS tracking code

Summary

FingerprintJS is a solution for quickly and accurately identifying users without requiring them to log in. My blog also uses FingerprintJS to provide the best experience for readers. If your next project requires user tracking without login, then you know what to do, right.

Premium
Hello

The secret stack of Blog

As a developer, are you curious about the technology secrets or the technical debts of this blog? All secrets will be revealed in the article below. What are you waiting for, click now!

As a developer, are you curious about the technology secrets or the technical debts of this blog? All secrets will be revealed in the article below. What are you waiting for, click now!

View all

Subscribe to receive new article notifications

or
* The summary newsletter is sent every 1-2 weeks, cancel anytime.

Comments (2)

Leave a comment...
Avatar
Ẩn danh1 year ago
Lúc trước mình nhớ bên này ra mắt tool anti browers mà nhỉ giờ tìm mãi không ra hay do nó đổi thành dự án này rồi nhỉ
Reply
Avatar
Xuân Hoài Tống1 year ago
Thế ạ, mình cũng chỉ nghe đến thư viện này giúp định danh trình duyệt. Nhưng vừa rồi họ mới chấm dứt bản miễn phí và bắt trả phí rồi, thế là đành phải chuyển qua phiên bản open source với độ chính xác thấp hơn chỉ khoảng 60% theo họ nói.
Avatar
Gin Na2 years ago
@gif [tIeCLkB8geYtW] Thư viện hay, phải login vào cmt cho bạn
Reply
Avatar
Xuân Hoài Tống2 years ago
Cảm ơn bạn đã tạo động lực cho mình