@picked/fingerprintjs 0.0.1-dev.1764631564450
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/README.md +11 -0
- package/dist/cjs/index.js +1 -0
- package/dist/esm/index.js +22 -0
- package/dist/types/index.d.ts +27 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +52 -0
package/README.md
ADDED
|
@@ -0,0 +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;
|
|
@@ -0,0 +1,22 @@
|
|
|
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);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function p() {
|
|
13
|
+
return console.log(
|
|
14
|
+
"====> Retrieving FingerprintJS visitorId from session store:",
|
|
15
|
+
n,
|
|
16
|
+
r.get(n)
|
|
17
|
+
), r.get(n);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
s as FingerprintJS,
|
|
21
|
+
p as getFingerprintVisitorId
|
|
22
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { StorageItem } from '@picked/client';
|
|
2
|
+
declare global {
|
|
3
|
+
interface Window {
|
|
4
|
+
FingerprintJS?: FingerprintJS;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
interface FingerprintJS {
|
|
8
|
+
load: () => Promise<{
|
|
9
|
+
get: () => Promise<{
|
|
10
|
+
visitorId: string;
|
|
11
|
+
}>;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Calls FingerprintJS to get the visitorId and stores it in the session store.
|
|
16
|
+
*
|
|
17
|
+
* @returns void
|
|
18
|
+
*/
|
|
19
|
+
export declare function FingerprintJS(): void;
|
|
20
|
+
/**
|
|
21
|
+
* Retrieves the FingerprintJS visitorId from the session store.
|
|
22
|
+
*
|
|
23
|
+
* @returns StorageItem<string | undefined> The stored visitorId or undefined if not present.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getFingerprintVisitorId(): StorageItem<string | undefined>;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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"}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@picked/fingerprintjs",
|
|
3
|
+
"description": "Fingerprintjs plugin",
|
|
4
|
+
"version": "0.0.1-dev.1764631564450",
|
|
5
|
+
"dependencies": {},
|
|
6
|
+
"devDependencies": {
|
|
7
|
+
"@picked/client": "workspace:*",
|
|
8
|
+
"@repo/eslint-config": "workspace:*",
|
|
9
|
+
"@repo/typescript-config": "workspace:*",
|
|
10
|
+
"@rollup/plugin-replace": "^6.0.2",
|
|
11
|
+
"@types/jsdom": "^21.1.7",
|
|
12
|
+
"@types/node": "^22",
|
|
13
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
14
|
+
"tsup": "^8.5.0",
|
|
15
|
+
"tsx": "^4.20.3",
|
|
16
|
+
"vite": "^6.4.1",
|
|
17
|
+
"vite-plugin-dts": "^4.5.4",
|
|
18
|
+
"vitest": "^3.2.4"
|
|
19
|
+
},
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/types/index.d.ts",
|
|
23
|
+
"import": "./dist/esm/index.js",
|
|
24
|
+
"require": "./dist/cjs/index.js",
|
|
25
|
+
"default": "./dist/esm/index.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"main": "./dist/cjs/index.js",
|
|
32
|
+
"module": "./dist/esm/index.js",
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@picked/client": "0.0.1-dev.1764631564450"
|
|
35
|
+
},
|
|
36
|
+
"private": false,
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "vite build",
|
|
39
|
+
"dev": "vite build --watch",
|
|
40
|
+
"lint": "eslint .",
|
|
41
|
+
"lint-files": "eslint",
|
|
42
|
+
"lint:format": "eslint . --fix",
|
|
43
|
+
"lint:report": "eslint . -o './.reports/eslint.json' -f json || true",
|
|
44
|
+
"type-check": "tsc -p . --noEmit",
|
|
45
|
+
"test": "vitest run",
|
|
46
|
+
"test:coverage": "vitest run --coverage",
|
|
47
|
+
"test:packaged-types": "attw --pack",
|
|
48
|
+
"test:watch": "vitest"
|
|
49
|
+
},
|
|
50
|
+
"type": "module",
|
|
51
|
+
"types": "./dist/types/index.d.ts"
|
|
52
|
+
}
|