Created
October 3, 2023 17:46
-
-
Save rajucs/449bca9b81e398da4dd0a1ae5a82c00b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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