Skip to content

Use as esm without cdn #800

Answered by makma
MentalGear asked this question in Q&A
Aug 17, 2022 · 1 comments · 5 replies
Discussion options

You must be logged in to vote

Hello @MentalGear, you can use the Webpack/Rollup/NPM/Yarn installation method documented here.

# Install the package first:
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()
  console.log(result.visitorId)
})()

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@MentalGear
Comment options

@makma
Comment options

@MentalGear
Comment options

@makma
Comment options

@MentalGear
Comment options

Answer selected by MentalGear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants