存储设备唯一标识(浏览器指纹库)

阅读 60

2022-04-13

https://github.com/fingerprintjs/fingerprintjs

1.npm安装 or yarn

npm i @fingerprintjs/fingerprintjs
# or
yarn add @fingerprintjs/fingerprintjs
import FingerprintJS from '@fingerprintjs/fingerprintjs'

// Initialize an agent at application startup.
const fpPromise = FingerprintJS.load()

;(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)
})()

精彩评论(0)

0 0 举报