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

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 n=require("@picked/client"),i=n.createStorageKey("fingerprintjs","global"),t=()=>({name:"fingerprintjs-plugin",setup:()=>{if(console.log("====> [fingerprintjsPlugin] Setting up FingerprintJS plugin"),!n.supportsWindow()){console.log("====> [fingerprintjsPlugin] Window is not supported");return}if(!window.FingerprintJS){console.log("====> [fingerprintjsPlugin] FingerprintJS not found on window"),n.sessionStore.set(i,void 0);return}window.FingerprintJS.load().then(({get:e})=>{e().then(({visitorId:r})=>{n.sessionStore.set(i,r),console.log("====> [fingerprintjsPlugin] FingerprintJS visitorId stored:",i,r)})})}});function o(){if(!n.supportsWindow()){console.log("====> [getFingerprintVisitorId] Window is not supported");return}return console.log("====> [getFingerprintVisitorId] Retrieving FingerprintJS visitorId from session store:",i,n.sessionStore.get(i).text()),n.sessionStore.get(i)}exports.fingerprintjsPlugin=t;exports.getFingerprintVisitorId=o;
package/dist/esm/index.js CHANGED
@@ -1,22 +1,38 @@
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 o, supportsWindow as t, sessionStore as i } from "@picked/client";
2
+ const n = o("fingerprintjs", "global"), p = () => ({
3
+ name: "fingerprintjs-plugin",
4
+ setup: () => {
5
+ if (console.log("====> [fingerprintjsPlugin] Setting up FingerprintJS plugin"), !t()) {
6
+ console.log("====> [fingerprintjsPlugin] Window is not supported");
7
+ return;
8
+ }
9
+ if (!window.FingerprintJS) {
10
+ console.log("====> [fingerprintjsPlugin] FingerprintJS not found on window"), i.set(n, void 0);
11
+ return;
12
+ }
13
+ window.FingerprintJS.load().then(({ get: e }) => {
14
+ e().then(({ visitorId: r }) => {
15
+ i.set(n, r), console.log(
16
+ "====> [fingerprintjsPlugin] FingerprintJS visitorId stored:",
17
+ n,
18
+ r
19
+ );
20
+ });
9
21
  });
10
- });
11
- }
12
- function p() {
22
+ }
23
+ });
24
+ function l() {
25
+ if (!t()) {
26
+ console.log("====> [getFingerprintVisitorId] Window is not supported");
27
+ return;
28
+ }
13
29
  return console.log(
14
- "====> Retrieving FingerprintJS visitorId from session store:",
30
+ "====> [getFingerprintVisitorId] Retrieving FingerprintJS visitorId from session store:",
15
31
  n,
16
- r.get(n)
17
- ), r.get(n);
32
+ i.get(n).text()
33
+ ), i.get(n);
18
34
  }
19
35
  export {
20
- s as FingerprintJS,
21
- p as getFingerprintVisitorId
36
+ p as fingerprintjsPlugin,
37
+ l as getFingerprintVisitorId
22
38
  };
@@ -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,16 +12,18 @@ 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
  *
23
25
  * @returns StorageItem<string | undefined> The stored visitorId or undefined if not present.
24
26
  */
25
- export declare function getFingerprintVisitorId(): StorageItem<string | undefined>;
27
+ export declare function getFingerprintVisitorId(): StorageItem<string | undefined> | undefined;
26
28
  export {};
27
29
  //# sourceMappingURL=index.d.ts.map
@@ -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,EAGL,WAAW,EAEX,KAAK,MAAM,EACZ,MAAM,gBAAgB,CAAA;AAEvB,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,MA+BtC,CAAA;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAYrF"}
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.1764694362099",
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.1764694362099"
35
35
  },
36
36
  "private": false,
37
37
  "scripts": {