How to use the fingerprintjs2.get function in fingerprintjs2

To help you get started, we’ve selected a few fingerprintjs2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OperationCode / front-end / pages / _app.js View on Github external
const setLogRocketFingerprint = () => {
  Fingerprint2.get(components => {
    const fingerprint = hash(components);
    LogRocket.identify(fingerprint);
  });
};
github feryandi / PilahPilihPilpres / fe / src / components / Home.js View on Github external
getUserIdentity() {
    const Fingerprint2 = require('fingerprintjs2');
    const options = {excludes: {userAgent: true}}

    const cookies = nookies.get()

    if (!cookies.hasOwnProperty('fp')) {
      Fingerprint2.get(options, (components) => {
          var values = components.map(function (component) { return component.value });
          var murmur = Fingerprint2.x64hash128(values.join(''), 31);
          nookies.set({}, 'fp', murmur, {
            maxAge: 30 * 24 * 60 * 60,
            path: '/',
          });
          this.getSession(murmur);
      });
    } else {
      this.getSession(cookies['fp']);
    }
  }

fingerprintjs2

Warning! The library is renamed to @fingerprintjs/fingerprintjs. See https://github.com/fingerprintjs/fingerprintjs to get updates.

MIT
Latest version published 3 years ago

Package Health Score

64 / 100
Full package analysis