@sho-js/fingerprint
TypeScript icon, indicating that this package has built-in type declarations

3.0.1 • Public • Published

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",
    }
)

Readme

Keywords

none

Package Sidebar

Install

npm i @sho-js/fingerprint

Weekly Downloads

2

Version

3.0.1

License

MIT

Unpacked Size

14.3 kB

Total Files

16

Last publish

Collaborators

  • horat1us
  • sashabeton