react-marketing-tools 1.0.0-alpha.5 → 1.0.0
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 +338 -24
- package/dist/attribution/attribution.d.ts +11 -4
- package/dist/autocapture/clicks.d.ts +11 -0
- package/dist/chunks/cookies.js +49 -0
- package/dist/chunks/core.js +357 -211
- package/dist/core/errors.d.ts +1 -1
- package/dist/core/types.d.ts +58 -3
- package/dist/core.d.ts +1 -1
- package/dist/destinations/serverRelay.d.ts +34 -0
- package/dist/fingerprintjs.d.ts +8 -0
- package/dist/fingerprintjs.js +7 -0
- package/dist/identity/visitorId.d.ts +14 -0
- package/dist/journeys/journey.d.ts +8 -0
- package/dist/server/aiCrawlers.d.ts +37 -0
- package/dist/server/conversionsApi.d.ts +38 -0
- package/dist/server/createTrackHandler.d.ts +20 -0
- package/dist/server/ga4Cookies.d.ts +11 -0
- package/dist/server/measurementProtocol.d.ts +34 -0
- package/dist/server/normalize.d.ts +19 -0
- package/dist/server.d.ts +10 -0
- package/dist/server.js +252 -0
- package/dist/shared/hash.d.ts +4 -0
- package/dist/shared/uuid.d.ts +1 -0
- package/dist/webVitals.d.ts +8 -0
- package/dist/webVitals.js +16 -0
- package/package.json +41 -6
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region lib/webVitals.ts
|
|
2
|
+
var e = /* @__PURE__ */ new WeakSet(), t = async (t) => {
|
|
3
|
+
if (typeof window > "u" || e.has(t)) return;
|
|
4
|
+
e.add(t);
|
|
5
|
+
let { onCLS: n, onINP: r, onLCP: i } = await import("web-vitals"), a = ({ name: e, value: n, delta: r, id: i, rating: a, navigationURL: o }) => t.track(e, {
|
|
6
|
+
value: r,
|
|
7
|
+
metric_id: i,
|
|
8
|
+
metric_value: n,
|
|
9
|
+
metric_delta: r,
|
|
10
|
+
metric_rating: a,
|
|
11
|
+
...o && { page_location: o }
|
|
12
|
+
}, { meta: !1 });
|
|
13
|
+
n(a), r(a), i(a);
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { t as trackWebVitals };
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-marketing-tools",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"description": "One track() call for Google Tag Manager, Google Analytics 4 and the Meta Pixel, with Consent Mode v2, UTM attribution and personal-data redaction built in. React bindings included.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "bronz3beard <exempli.gratia.webdesign@gmail.com> (https://www.heyrory.com/)",
|
|
8
|
-
"homepage": "https://
|
|
8
|
+
"homepage": "https://bronz3beard.github.io/react-marketing-tools/",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/bronz3beard/react-marketing-tools.git"
|
|
@@ -32,7 +32,14 @@
|
|
|
32
32
|
"gdpr",
|
|
33
33
|
"utm",
|
|
34
34
|
"attribution",
|
|
35
|
-
"server-side-tagging"
|
|
35
|
+
"server-side-tagging",
|
|
36
|
+
"conversions-api",
|
|
37
|
+
"measurement-protocol",
|
|
38
|
+
"web-vitals",
|
|
39
|
+
"consent",
|
|
40
|
+
"privacy",
|
|
41
|
+
"nextjs",
|
|
42
|
+
"typescript"
|
|
36
43
|
],
|
|
37
44
|
"main": "./dist/index.js",
|
|
38
45
|
"types": "./dist/index.d.ts",
|
|
@@ -45,6 +52,18 @@
|
|
|
45
52
|
"types": "./dist/core.d.ts",
|
|
46
53
|
"default": "./dist/core.js"
|
|
47
54
|
},
|
|
55
|
+
"./server": {
|
|
56
|
+
"types": "./dist/server.d.ts",
|
|
57
|
+
"default": "./dist/server.js"
|
|
58
|
+
},
|
|
59
|
+
"./fingerprintjs": {
|
|
60
|
+
"types": "./dist/fingerprintjs.d.ts",
|
|
61
|
+
"default": "./dist/fingerprintjs.js"
|
|
62
|
+
},
|
|
63
|
+
"./web-vitals": {
|
|
64
|
+
"types": "./dist/webVitals.d.ts",
|
|
65
|
+
"default": "./dist/webVitals.js"
|
|
66
|
+
},
|
|
48
67
|
"./package.json": "./package.json"
|
|
49
68
|
},
|
|
50
69
|
"sideEffects": false,
|
|
@@ -57,8 +76,12 @@
|
|
|
57
76
|
"scripts": {
|
|
58
77
|
"build": "vite build && tsc -p tsconfig.build.json",
|
|
59
78
|
"build:watch": "vite build --watch",
|
|
79
|
+
"check:api-summary": "node scripts/check-api-summary.mjs",
|
|
80
|
+
"check:links": "node scripts/check-links.mjs",
|
|
60
81
|
"check:package": "publint --strict && attw --pack . --profile esm-only",
|
|
61
82
|
"check:size": "node scripts/check-size.mjs",
|
|
83
|
+
"demo:build": "vite build --config demo/vite.config.ts",
|
|
84
|
+
"demo:dev": "vite --config demo/vite.config.ts",
|
|
62
85
|
"format": "prettier --write .",
|
|
63
86
|
"format:check": "prettier --check .",
|
|
64
87
|
"lint": "eslint .",
|
|
@@ -69,15 +92,26 @@
|
|
|
69
92
|
"typecheck": "tsc --noEmit"
|
|
70
93
|
},
|
|
71
94
|
"peerDependencies": {
|
|
72
|
-
"
|
|
95
|
+
"@fingerprintjs/fingerprintjs": "^5.0.0",
|
|
96
|
+
"react": ">=18.0.0",
|
|
97
|
+
"web-vitals": "^6.0.0"
|
|
98
|
+
},
|
|
99
|
+
"peerDependenciesMeta": {
|
|
100
|
+
"@fingerprintjs/fingerprintjs": {
|
|
101
|
+
"optional": true
|
|
102
|
+
},
|
|
103
|
+
"web-vitals": {
|
|
104
|
+
"optional": true
|
|
105
|
+
}
|
|
73
106
|
},
|
|
74
107
|
"devDependencies": {
|
|
75
108
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
109
|
+
"@eslint/js": "^10.0.1",
|
|
110
|
+
"@fingerprintjs/fingerprintjs": "^5.2.0",
|
|
76
111
|
"@types/node": "^22.20.4",
|
|
77
112
|
"@types/react": "^19.3.0",
|
|
78
113
|
"@types/react-dom": "^19.3.0",
|
|
79
114
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
80
|
-
"@eslint/js": "^10.0.1",
|
|
81
115
|
"eslint": "^10.11.0",
|
|
82
116
|
"eslint-config-prettier": "^10.1.8",
|
|
83
117
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
@@ -89,6 +123,7 @@
|
|
|
89
123
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
90
124
|
"typescript-eslint": "^8.70.0",
|
|
91
125
|
"vite": "^8.3.0",
|
|
92
|
-
"vitest": "^5.0.1"
|
|
126
|
+
"vitest": "^5.0.1",
|
|
127
|
+
"web-vitals": "^6.2.2"
|
|
93
128
|
}
|
|
94
129
|
}
|