0
点赞
收藏
分享

微信扫一扫

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

回望这一段人生 2022-04-13 阅读 60
前端

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 条评论