@fingerprint/agent

中文文档
4.1.6发布于 2026/10/07SEE LICENSE IN LICENSETypeScriptESM + CJS零依赖近 30 天下载 95.9万

Fingerprint JavaScript agent

原始使用文档
文档目录4 节
  1. Quick start
  2. Install from NPM
  3. Alternatively you can install from CDN
  4. See also


Fingerprint logo

Makes a website visitor identifier from a browser fingerprint. Unlike cookies and local storage, fingerprint stays the same in incognito/private mode and even when browser data is purged. Provides additional information and higher accuracy compared to Open Source FingerprintJS.

Quick start

Get a pro key:

  1. Register a new PRO account at dashboard.fingerprint.com/signup (there is a free trial)
  2. After registration go to the dashboard and select the created subscription
  3. Go the "API Keys" page in the navigation side bar on the left side of the page
  4. Copy a key with type "Public"

Install from NPM

npm i @fingerprint/agent
# or
yarn add @fingerprint/agent
# or
pnpm add @fingerprint/agent
# or
bun add @fingerprint/agent
import Fingerprint from '@fingerprint/agent'

// Initialize an agent at application startup.
const fpPromise = Fingerprint.start({ apiKey: 'your-pro-key' })

;(async () => {
  // Get the visitor identifier when you need it.
  const fp = await fpPromise
  const result = await fp.get()

  // This is the visitor identifier:
  const visitorId = result.visitorId
  console.log(visitorId)
})()

Run this code

Alternatively you can install from CDN

<script>
  // Initialize the agent at application startup.
  const fpPromise = import('https://fpjscdn.net/v4/your-pro-key')
    .then(FingerprintJS => FingerprintJS.start())

  // Get the visitor identifier when you need it.
  fpPromise
    .then(fp => fp.get())
    .then(result => {
      // This is the visitor identifier:
      const visitorId = result.visitorId
      console.log(visitorId)
    })
</script>

Note that you need to replace your-pro-key with a public API key from the dashboard.

Run this code

See also

🍿 Live demo

⏱ How to upgrade from Open Source to Pro in 30 seconds

⬆️ How to migrate from Fingerprint version 3

📕 Fingerprint documentation

▶️ Video: use Fingerprint to prevent multiple signups

版本与发布记录

@fingerprint/agent 共发布 14 个版本,首次发布于 2025/11/06;过去 12 个月发布了 13 个版本。

版本发布日期距今
4.1.6latest2026/10/071 个月前
4.1.52026/09/012 个月前
4.1.42026/08/113 个月前
4.1.32026/07/213 个月前
4.1.22026/07/084 个月前
4.1.12026/06/194 个月前

其他发布通道:beta → 4.0.0-beta.5。

关于 @fingerprint/agent 的常见问题

@fingerprint/agent 是什么?

Fingerprint JavaScript agent

如何安装 @fingerprint/agent?

在项目目录运行 npm install @fingerprint/agent,或使用 pnpm add / yarn add / bun add。

@fingerprint/agent 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@fingerprint/agent 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@fingerprint/agent 可以商用吗?

@fingerprint/agent 使用 SEE LICENSE IN LICENSE 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@fingerprint/agent 的下载量有多少?

根据 npm 官方下载统计,@fingerprint/agent 在 2026/10/15 – 2026/11/13 这 30 天内被下载 958,912 次,日均约 31,964 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fingerprint/agent 还在维护吗?

最新版本 4.1.6 发布于 2026/10/07(1 个月前);至今共发布 14 个版本,其中过去 12 个月发布了 13 个;首次发布于 2025/11/06。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。