@sho-js/fingerprint
v3.0.1
Published
Library for generating fingerprint
Downloads
1
Readme
Wearesho Fingerprint Generator
Installation
npm i --save @sho-js/fingerprint
Peer dependencies:
Usage
Setup and generation
import * as FingerPrint from "@sho-js/fingerprint";
// generating token based on random and current timestamp
FingerPrint.simple()
.then((randomToken) => console.log(randomToken));
// https://github.com/Valve/fingerprintjs2
FingerPrint.fp2()
.catch(FingerPrint.simple) // fallback to random token on error
.then((fp2token) => console.log(fp2token));
// https://github.com/js-cookie/js-cookie
FingerPrint.cookie(
FingerPrint.fp2(), // fallback if no cookie
"cookie.name",
{ // cookie attributes, see js-cookie for details
domain: ".wearesho.com",
}
)