@picked/fingerprintjs 0.0.1-dev.1764631564450 → 0.0.1-dev.1764633009920

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@picked/client"),e=n.createStorageKey("fingerprintjs","global");function t(){if(!window.FingerprintJS)return;window.FingerprintJS.load().then(({get:r})=>{r().then(({visitorId:i})=>{n.sessionStore.set(e,i),console.log("====> FingerprintJS visitorId stored:",e,i)})})}function o(){return console.log("====> Retrieving FingerprintJS visitorId from session store:",e,n.sessionStore.get(e)),n.sessionStore.get(e)}exports.FingerprintJS=t;exports.getFingerprintVisitorId=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@picked/client"),n=e.createStorageKey("fingerprintjs","global"),t=()=>({name:"fingerprintjs-plugin",setup:()=>{if(console.log("====> Setting up FingerprintJS plugin"),!window.FingerprintJS){console.log("====> FingerprintJS not found on window"),e.sessionStore.set(n,void 0);return}window.FingerprintJS.load().then(({get:r})=>{r().then(({visitorId:i})=>{e.sessionStore.set(n,i),console.log("====> FingerprintJS visitorId stored:",n,i)})})}});function o(){return console.log("====> Retrieving FingerprintJS visitorId from session store:",n,e.sessionStore.get(n)),e.sessionStore.get(n)}exports.fingerprintjsPlugin=t;exports.getFingerprintVisitorId=o;
package/dist/esm/index.js CHANGED
@@ -1,22 +1,26 @@
1
- import { createStorageKey as t, sessionStore as r } from "@picked/client";
2
- const n = t("fingerprintjs", "global");
3
- function s() {
4
- if (!window.FingerprintJS)
5
- return;
6
- window.FingerprintJS.load().then(({ get: e }) => {
7
- e().then(({ visitorId: i }) => {
8
- r.set(n, i), console.log("====> FingerprintJS visitorId stored:", n, i);
1
+ import { createStorageKey as t, sessionStore as i } from "@picked/client";
2
+ const n = t("fingerprintjs", "global"), s = () => ({
3
+ name: "fingerprintjs-plugin",
4
+ setup: () => {
5
+ if (console.log("====> Setting up FingerprintJS plugin"), !window.FingerprintJS) {
6
+ console.log("====> FingerprintJS not found on window"), i.set(n, void 0);
7
+ return;
8
+ }
9
+ window.FingerprintJS.load().then(({ get: e }) => {
10
+ e().then(({ visitorId: r }) => {
11
+ i.set(n, r), console.log("====> FingerprintJS visitorId stored:", n, r);
12
+ });
9
13
  });
10
- });
11
- }
14
+ }
15
+ });
12
16
  function p() {
13
17
  return console.log(
14
18
  "====> Retrieving FingerprintJS visitorId from session store:",
15
19
  n,
16
- r.get(n)
17
- ), r.get(n);
20
+ i.get(n)
21
+ ), i.get(n);
18
22
  }
19
23
  export {
20
- s as FingerprintJS,
24
+ s as fingerprintjsPlugin,
21
25
  p as getFingerprintVisitorId
22
26
  };
@@ -1,4 +1,4 @@
1
- import { StorageItem } from '@picked/client';
1
+ import { StorageItem, Plugin } from '@picked/client';
2
2
  declare global {
3
3
  interface Window {
4
4
  FingerprintJS?: FingerprintJS;
@@ -12,11 +12,13 @@ interface FingerprintJS {
12
12
  }>;
13
13
  }
14
14
  /**
15
- * Calls FingerprintJS to get the visitorId and stores it in the session store.
15
+ * FingerprintJS plugin.
16
16
  *
17
- * @returns void
17
+ * This plugin gets the visitorId from FingerprintJS and stores it in the session store.
18
+ *
19
+ * @returns FingerprintJS plugin.
18
20
  */
19
- export declare function FingerprintJS(): void;
21
+ export declare const fingerprintjsPlugin: () => Plugin;
20
22
  /**
21
23
  * Retrieves the FingerprintJS visitorId from the session store.
22
24
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5E,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,aAAa,CAAC,EAAE,aAAa,CAAA;KAC9B;CACF;AAED,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,OAAO,CAAC;YAAE,SAAS,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC,CAAA;CACnE;AAID;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAapC;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAOzE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAEzF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,aAAa,CAAC,EAAE,aAAa,CAAA;KAC9B;CACF;AAED,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,OAAO,CAAC;YAAE,SAAS,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC,CAAA;CACnE;AAID;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,QAAO,MAsBtC,CAAA;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAOzE"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@picked/fingerprintjs",
3
3
  "description": "Fingerprintjs plugin",
4
- "version": "0.0.1-dev.1764631564450",
4
+ "version": "0.0.1-dev.1764633009920",
5
5
  "dependencies": {},
6
6
  "devDependencies": {
7
7
  "@picked/client": "workspace:*",
@@ -31,7 +31,7 @@
31
31
  "main": "./dist/cjs/index.js",
32
32
  "module": "./dist/esm/index.js",
33
33
  "peerDependencies": {
34
- "@picked/client": "0.0.1-dev.1764631564450"
34
+ "@picked/client": "0.0.1-dev.1764633009920"
35
35
  },
36
36
  "private": false,
37
37
  "scripts": {