From 3baa070613f958a2a98046630bb723d2c604ba49 Mon Sep 17 00:00:00 2001 From: tobinio Date: Wed, 19 Jun 2024 20:57:21 +0200 Subject: [PATCH] chore: remove posthog --- nuxt.config.ts | 6 ------ package.json | 1 - plugins/posthog.client.ts | 30 ------------------------------ 3 files changed, 37 deletions(-) delete mode 100644 plugins/posthog.client.ts diff --git a/nuxt.config.ts b/nuxt.config.ts index 7db0b51..5809b33 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -8,12 +8,6 @@ export default defineNuxtConfig({ ] } }, - runtimeConfig: { - public: { - posthogPublicKey: 'phc_vD7xT8ICrEYHimKUBG3SJUeMqSKrvq0v9rQsQGW4cI9', - posthogHost: 'https://eu.i.posthog.com' - } - }, routeRules: { "/downloads": { redirect: "/downloads/major" diff --git a/package.json b/package.json index 60632bb..9b8a243 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,6 @@ "dependencies": { "chart.js": "^4.4.3", "nuxt": "^3.12.2", - "posthog-js": "^1.139.3", "vue": "^3.4.29", "vue-chartjs": "^5.3.1", "vue-router": "^4.3.3" diff --git a/plugins/posthog.client.ts b/plugins/posthog.client.ts deleted file mode 100644 index 2ad8ebc..0000000 --- a/plugins/posthog.client.ts +++ /dev/null @@ -1,30 +0,0 @@ -import {defineNuxtPlugin} from '#app' -import posthog from 'posthog-js' - -export default defineNuxtPlugin(nuxtApp => { - const runtimeConfig = useRuntimeConfig(); - const posthogClient = posthog.init(runtimeConfig.public.posthogPublicKey, { - api_host: runtimeConfig.public.posthogHost, - person_profiles: 'identified_only', // or 'always' to create profiles for anonymous users as well - capture_pageview: false, // we add manual pageview capturing below - loaded: (posthog) => { - if (import.meta.env.MODE === 'development') posthog.debug(); - } - }) - - // Make sure that pageviews are captured with each route change - const router = useRouter(); - router.afterEach((to) => { - nextTick(() => { - posthog.capture('$pageview', { - current_url: to.fullPath - }); - }); - }); - - return { - provide: { - posthog: () => posthogClient - } - } -}) \ No newline at end of file -- 2.51.2