From ff911cfb9f183f358de424cf05de5ad24872627b Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 20 Aug 2026 15:58:58 +0000 Subject: [PATCH 1/2] docs(playground): add Swetrix pageview/error tracking Add analytics plugin to track pageviews and errors on v0play.vuetifyjs.com. - Create analytics plugin with pid NYQnHCV4oCFA and Vuetify Swetrix API - Import plugin in main.ts inside SSR guard block - Add swetrix dependency using workspace catalog --- apps/playground/package.json | 1 + apps/playground/src/main.ts | 1 + apps/playground/src/plugins/analytics.ts | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 apps/playground/src/plugins/analytics.ts diff --git a/apps/playground/package.json b/apps/playground/package.json index afd93f5eea..e2a9fe5a4a 100644 --- a/apps/playground/package.json +++ b/apps/playground/package.json @@ -17,6 +17,7 @@ "client-zip": "catalog:", "fflate": "catalog:", "pinia": "catalog:", + "swetrix": "catalog:", "vue": "catalog:" }, "devDependencies": { diff --git a/apps/playground/src/main.ts b/apps/playground/src/main.ts index 039609667f..4fbc8a1e09 100644 --- a/apps/playground/src/main.ts +++ b/apps/playground/src/main.ts @@ -99,6 +99,7 @@ export const createApp = ViteSSG( pinia.state.value = initialState.pinia || {} if (!import.meta.env.SSR) { + await import('./plugins/analytics') const { useAuthStore } = await import('@vuetify/auth') useAuthStore().verify() } diff --git a/apps/playground/src/plugins/analytics.ts b/apps/playground/src/plugins/analytics.ts new file mode 100644 index 0000000000..98a6446a51 --- /dev/null +++ b/apps/playground/src/plugins/analytics.ts @@ -0,0 +1,20 @@ +// Framework +import { IN_BROWSER } from '@vuetify/v0/constants' + +async function initAnalytics () { + const Swetrix = await import('swetrix') + Swetrix.init('NYQnHCV4oCFA', { + apiURL: 'https://swetrix-api.vuetifyjs.com/log', + }) + Swetrix.trackViews() + Swetrix.trackErrors() +} + +if (IN_BROWSER) { + const timeout = 2000 + if (typeof requestIdleCallback === 'function') { + requestIdleCallback(() => initAnalytics(), { timeout }) + } else { + setTimeout(initAnalytics, timeout) + } +} From daf04b6c5ab1625ccc92e76d713189a4d3403088 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 20 Aug 2026 16:04:28 +0000 Subject: [PATCH 2/2] chore: update lockfile for playground swetrix dependency --- pnpm-lock.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0ce8b56aa7..9d48a55b5c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -532,6 +532,9 @@ importers: pinia: specifier: 'catalog:' version: 3.0.4(typescript@6.0.3)(vue@3.5.39(typescript@6.0.3)) + swetrix: + specifier: 'catalog:' + version: 4.4.0 vue: specifier: 'catalog:' version: 3.5.39(typescript@6.0.3)