@temps-sdk/vue-analytics 0.0.1 → 0.0.5
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/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +2 -0
- package/dist/useEngagementTracking.d.ts.map +1 -1
- package/dist/useEngagementTracking.js +2 -0
- package/dist/usePageLeave.d.ts +7 -0
- package/dist/usePageLeave.d.ts.map +1 -1
- package/dist/usePageLeave.js +4 -2
- package/dist/useScrollVisibility.d.ts.map +1 -1
- package/dist/useScrollVisibility.js +2 -0
- package/dist/useSessionRecording.d.ts.map +1 -1
- package/dist/useSessionRecording.js +2 -0
- package/dist/useTempsAnalytics.d.ts.map +1 -1
- package/dist/useTempsAnalytics.js +2 -0
- package/dist/useTrackEvent.d.ts.map +1 -1
- package/dist/useTrackEvent.js +2 -0
- package/dist/useTrackPageview.d.ts.map +1 -1
- package/dist/useTrackPageview.js +2 -0
- package/package.json +2 -2
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EACL,qBAAqB,EACrB,KAAK,4BAA4B,GAClC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,mBAAmB,EACnB,KAAK,0BAA0B,GAChC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mBAAmB,EACnB,KAAK,yBAAyB,GAC/B,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2024-2026 Temps Contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
1
3
|
export * from "@temps-sdk/analytics-core";
|
|
2
4
|
export { TempsAnalyticsPlugin, TempsAnalyticsKey } from "./plugin";
|
|
3
5
|
export { useTempsAnalytics } from "./useTempsAnalytics";
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAO,YAAY,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAmB,KAAK,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAEtG,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,YAAY,CAA4B,CAAC;AAEtF,MAAM,WAAW,2BAA4B,SAAQ,gBAAgB;IACnE;;;OAGG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,2BAA2B,GAAG,SAAS,CAchF,CAAC;AAEF,OAAO,QAAQ,KAAK,CAAC;IACnB,UAAU,yBAAyB;QACjC,MAAM,EAAE,YAAY,CAAC;KACtB;CACF"}
|
package/dist/plugin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEngagementTracking.d.ts","sourceRoot":"","sources":["../src/useEngagementTracking.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useEngagementTracking.d.ts","sourceRoot":"","sources":["../src/useEngagementTracking.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmC,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAChE,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC9B,MAAM,2BAA2B,CAAC;AAGnC,MAAM,WAAW,4BACf,SAAQ,IAAI,CAAC,wBAAwB,EAAE,UAAU,GAAG,QAAQ,CAAC;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IACpD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;CAC9C;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,GAAE,4BAAiC,GACzC;IACD,cAAc,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IACpC,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;CAC1B,CAsCA"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2024-2026 Temps Contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
1
3
|
import { onBeforeUnmount, onMounted, ref } from "vue";
|
|
2
4
|
import { EngagementTracker, } from "@temps-sdk/analytics-core";
|
|
3
5
|
import { useTempsAnalytics } from "./useTempsAnalytics";
|
package/dist/usePageLeave.d.ts
CHANGED
|
@@ -8,6 +8,13 @@ export interface UsePageLeaveOptions {
|
|
|
8
8
|
enabled?: boolean;
|
|
9
9
|
/** Override base path (falls back to the one used by the plugin). */
|
|
10
10
|
basePath?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Analytics ingest key (`pa_…`). This hook sends its unload beacon directly
|
|
13
|
+
* rather than through the plugin instance. Defaults to the key the plugin
|
|
14
|
+
* was initialized with (`useTempsAnalytics().ingestKey`); only pass this to
|
|
15
|
+
* override it for this hook specifically.
|
|
16
|
+
*/
|
|
17
|
+
ingestKey?: string;
|
|
11
18
|
}
|
|
12
19
|
export declare function usePageLeave(options?: UsePageLeaveOptions): {
|
|
13
20
|
triggerPageLeave: () => Promise<void> | void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePageLeave.d.ts","sourceRoot":"","sources":["../src/usePageLeave.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePageLeave.d.ts","sourceRoot":"","sources":["../src/usePageLeave.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAI3D,MAAM,WAAW,mBAAmB;IAClC,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACtC,+DAA+D;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG;IAC/D,gBAAgB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAC9C,CAiEA"}
|
package/dist/usePageLeave.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2024-2026 Temps Contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
1
3
|
import { onBeforeUnmount, onMounted, ref } from "vue";
|
|
2
4
|
import { DEFAULT_BASE_PATH, sendAnalyticsReliable } from "@temps-sdk/analytics-core";
|
|
3
5
|
import { useTempsAnalytics } from "./useTempsAnalytics";
|
|
4
6
|
export function usePageLeave(options = {}) {
|
|
5
|
-
const { eventName = "page_leave", eventData = {}, enabled = true, basePath = DEFAULT_BASE_PATH, } = options;
|
|
6
7
|
const analytics = useTempsAnalytics();
|
|
8
|
+
const { eventName = "page_leave", eventData = {}, enabled = true, basePath = DEFAULT_BASE_PATH, ingestKey = analytics.ingestKey, } = options;
|
|
7
9
|
const hasTracked = ref(false);
|
|
8
10
|
const startTime = ref(null);
|
|
9
11
|
const handler = () => {
|
|
@@ -23,7 +25,7 @@ export function usePageLeave(options = {}) {
|
|
|
23
25
|
url: window.location.href,
|
|
24
26
|
referrer: document.referrer,
|
|
25
27
|
},
|
|
26
|
-
}, basePath);
|
|
28
|
+
}, basePath, ingestKey);
|
|
27
29
|
};
|
|
28
30
|
onMounted(() => {
|
|
29
31
|
if (!enabled || !analytics.enabled)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScrollVisibility.d.ts","sourceRoot":"","sources":["../src/useScrollVisibility.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useScrollVisibility.d.ts","sourceRoot":"","sources":["../src/useScrollVisibility.ts"],"names":[],"mappings":"AAGA,OAAO,EAA+B,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAG3D,MAAM,WAAW,0BAA0B;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,0BAA+B,GACvC,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,CA+CzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSessionRecording.d.ts","sourceRoot":"","sources":["../src/useSessionRecording.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSessionRecording.d.ts","sourceRoot":"","sources":["../src/useSessionRecording.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAK9C,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACxB,SAAS,EAAE,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC9B,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,cAAc,UAAQ,GAAG,yBAAyB,CAmCrF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTempsAnalytics.d.ts","sourceRoot":"","sources":["../src/useTempsAnalytics.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTempsAnalytics.d.ts","sourceRoot":"","sources":["../src/useTempsAnalytics.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG9D,wBAAgB,iBAAiB,IAAI,YAAY,CAQhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTrackEvent.d.ts","sourceRoot":"","sources":["../src/useTrackEvent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTrackEvent.d.ts","sourceRoot":"","sources":["../src/useTrackEvent.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAG3D,wBAAgB,aAAa,IAAI,CAC/B,SAAS,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,KAC7B,OAAO,CAAC,IAAI,CAAC,CAGjB"}
|
package/dist/useTrackEvent.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTrackPageview.d.ts","sourceRoot":"","sources":["../src/useTrackPageview.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTrackPageview.d.ts","sourceRoot":"","sources":["../src/useTrackPageview.ts"],"names":[],"mappings":"AAKA,wBAAgB,gBAAgB,IAAI,MAAM,IAAI,CAG7C"}
|
package/dist/useTrackPageview.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temps-sdk/vue-analytics",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Temps analytics for Vue 3 — plugin + composables for events, Web Vitals, engagement, and session replay.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"vue": "^3.3.0"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@temps-sdk/analytics-core": "
|
|
33
|
+
"@temps-sdk/analytics-core": "workspace:*"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"typescript": "^5.5.4",
|