@fingerprintjs/fingerprintjs-pro-server-api

中文文档
6.13.1发布于 2026/09/14MITTypeScriptESM + CJS零依赖构建来源已验证近 30 天下载 41.1万

Node.js wrapper for FingerprintJS Sever API

原始使用文档
文档目录10 节
  1. Requirements
  2. How to install
  3. Getting started
  4. Error handling
  5. Webhooks
  6. Sealed results
  7. Deleting visitor data
  8. Semantic versioning
  9. Support and feedback
  10. License

Fingerprint logo

Current NPM version Monthly downloads from NPM Discord server

Fingerprint Server API Node.js SDK

Fingerprint is a device intelligence platform offering industry-leading accuracy.

The Fingerprint Server Node SDK is an easy way to interact with the Fingerprint Server API from your Node application. You can search, update, or delete identification events.

🚧 Deprecation Notice

This version of Server API is marked as deprecated starting on Jan 7th 2026 and will be fully defunct on Jan 7th 2027 according to our API Deprecation Policy. If you still use this version, please follow our migration guide to migrate from this deprecated version to the new one.

Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device.

Requirements

TypeScript support:

  • TypeScript 4.5.5 or higher

Supported runtimes:

  • Node.js 18 LTS or higher (we support all Node LTS releases before end-of-life).

  • Deno and Bun might work but are not actively tested.

  • "Edge" runtimes might work with some modifications but are not actively tested.

    See "edge" runtimes compatibility

    This SDK can be made compatible with JavaScript "edge" runtimes that do not support all Node APIs, for example, Vercel Edge Runtime, or Cloudflare Workers.

    To make it work, replace the SDK's built-in fetch function (which relies on Node APIs) with the runtime's native fetch function. Pass the function into the constructor with proper binding:

    const client = new FingerprintJsServerApiClient({
      region: Region.EU,
      apiKey: apiKey,
      fetch: fetch.bind(globalThis),
    })
    

How to install

Install the package using your favorite package manager:

  • NPM:

    npm i @fingerprintjs/fingerprintjs-pro-server-api
    
  • Yarn:

    yarn add @fingerprintjs/fingerprintjs-pro-server-api
    
  • pnpm:

    pnpm i @fingerprintjs/fingerprintjs-pro-server-api
    

Getting started

Initialize the client instance and use it to make API requests. You need to specify your Fingerprint Secret API key and the region of your Fingerprint workspace.

import {
  FingerprintJsServerApiClient,
  Region,
} from '@fingerprintjs/fingerprintjs-pro-server-api'

const client = new FingerprintJsServerApiClient({
  apiKey: '<SECRET_API_KEY>',
  region: Region.Global,
})

// Get visit history of a specific visitor
client.getVisits('<visitorId>').then((visitorHistory) => {
  console.log(visitorHistory)
})

// Get a specific identification event
client.getEvent('<requestId>').then((event) => {
  console.log(event)
})

// Search for identification events
client
  .searchEvents({
    limit: 10,
//    pagination_key: previousSearchResult.paginationKey,
    suspect: true,
  })
  .then((events) => {
    console.log(events)
  })

See the Examples folder for more detailed examples.

Error handling

The Server API methods can throw RequestError. When handling errors, you can check for it like this:

import {
  RequestError,
  FingerprintJsServerApiClient,
  TooManyRequestsError,
} from '@fingerprintjs/fingerprintjs-pro-server-api'

const client = new FingerprintJsServerApiClient({
  apiKey: '<SECRET_API_KEY>',
  region: Region.Global,
})

// Handling getEvent errors
try {
  const event = await client.getEvent(requestId)
  console.log(JSON.stringify(event, null, 2))
} catch (error) {
  if (error instanceof RequestError) {
    console.log(error.responseBody) // Access parsed response body
    console.log(error.response) // You can also access the raw response
    console.log(`error ${error.statusCode}: `, error.message)
  } else {
    console.log('unknown error: ', error)
  }
}

// Handling getVisits errors
try {
  const visitorHistory = await client.getVisits(visitorId, {
    limit: 10,
  })
  console.log(JSON.stringify(visitorHistory, null, 2))
} catch (error) {
  if (error instanceof RequestError) {
    console.log(error.status, error.error)
    if (error instanceof TooManyRequestsError) {
      retryLater(error.retryAfter) // Needs to be implemented on your side
    }
  } else {
    console.error('unknown error: ', error)
  }

  // You can also check for specific error instance
  // if(error instanceof VisitorsError403) {
  //    Handle 403 error...
  // }
}

Webhooks

Webhook types

When handling Webhooks coming from Fingerprint, you can cast the payload as the built-in VisitWebhook type:

import { VisitWebhook } from '@fingerprintjs/fingerprintjs-pro-server-api'

const visit = visitWebhookBody as unknown as VisitWebhook

Webhook signature validation

Customers on the Enterprise plan can enable Webhook signatures to cryptographically verify the authenticity of incoming webhooks. This SDK provides a utility method for verifying the HMAC signature of the incoming webhook request.

To learn more, see example/validateWebhookSignature.mjs.

Sealed results

Customers on the Enterprise plan can enable Sealed results to receive the full device intelligence result on the client and unseal it on the server. This SDK provides utility methods for decoding sealed results.

To learn more, see example/unsealResult.mjs.

Deleting visitor data

Customers on the Enterprise plan can Delete all data associated with a specific visitor to comply with privacy regulations. See example/deleteVisitor.mjs.

Semantic versioning

  • Changes to types in this repository are considered non-breaking and are usually released as PATCH or MINOR semver changes (otherwise every schema addition would be a major version upgrade).
  • It is highly recommended that you lock your package version to a specific PATCH release and upgrade with the expectation that types may be upgraded between any release.
  • The runtime (non-type-related) public API of the Node SDK still follows semver strictly.

Support and feedback

To report problems, ask questions, or provide feedback, please use Issues. If you need private support, you can email us at [email protected].

License

This project is licensed under the MIT license.

版本与发布记录

@fingerprintjs/fingerprintjs-pro-server-api 共发布 65 个版本,首次发布于 2021/07/28;过去 12 个月发布了 4 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
6.13.1latest2026/09/142 个月前
6.13.02026/09/092 个月前
6.12.02026/08/043 个月前
6.11.02026/04/147 个月前
6.10.02025/09/101.2 年前
6.10.0-test.1test2025/09/081.2 年前

关于 @fingerprintjs/fingerprintjs-pro-server-api 的常见问题

@fingerprintjs/fingerprintjs-pro-server-api 是什么?

Node.js wrapper for FingerprintJS Sever API

如何安装 @fingerprintjs/fingerprintjs-pro-server-api?

在项目目录运行 npm install @fingerprintjs/fingerprintjs-pro-server-api,或使用 pnpm add / yarn add / bun add。

@fingerprintjs/fingerprintjs-pro-server-api 支持 TypeScript 吗?

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

@fingerprintjs/fingerprintjs-pro-server-api 支持 ESM 还是 CommonJS?

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

@fingerprintjs/fingerprintjs-pro-server-api 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.17.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@fingerprintjs/fingerprintjs-pro-server-api 可以商用吗?

@fingerprintjs/fingerprintjs-pro-server-api 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@fingerprintjs/fingerprintjs-pro-server-api 的下载量有多少?

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

@fingerprintjs/fingerprintjs-pro-server-api 还在维护吗?

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