Skip to content

Instantly share code, notes, and snippets.

@rajucs
Created October 3, 2023 17:46
Show Gist options
  • Save rajucs/449bca9b81e398da4dd0a1ae5a82c00b to your computer and use it in GitHub Desktop.
Save rajucs/449bca9b81e398da4dd0a1ae5a82c00b to your computer and use it in GitHub Desktop.
<script>
// Initialize the agent at application startup.
const fpPromise = import('https://openfpcdn.io/fingerprintjs/v4')
.then(FingerprintJS => FingerprintJS.load())
// 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)
})
.catch(error => console.error(error))
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment