diff --git a/apps/basic-integration/vue/movies/.env.example b/apps/basic-integration/vue/movies/.env.example new file mode 100644 index 000000000..ddc2c8b74 --- /dev/null +++ b/apps/basic-integration/vue/movies/.env.example @@ -0,0 +1,2 @@ +VITE_POSTHOG_PROJECT_TOKEN=your_posthog_project_token +VITE_POSTHOG_HOST=https://us.i.posthog.com diff --git a/apps/basic-integration/vue/movies/.gitignore b/apps/basic-integration/vue/movies/.gitignore index cd68f1402..eb0c735c9 100644 --- a/apps/basic-integration/vue/movies/.gitignore +++ b/apps/basic-integration/vue/movies/.gitignore @@ -37,3 +37,4 @@ __screenshots__/ # Vite *.timestamp-*-*.mjs +.env diff --git a/apps/basic-integration/vue/movies/package-lock.json b/apps/basic-integration/vue/movies/package-lock.json index 23b2cfda4..cada3e711 100644 --- a/apps/basic-integration/vue/movies/package-lock.json +++ b/apps/basic-integration/vue/movies/package-lock.json @@ -12,6 +12,7 @@ "lru-cache": "^10.2.0", "ohash": "^1.1.3", "pinia": "^3.0.4", + "posthog-js": "^1.441.2", "vue": "^3.5.27", "vue-router": "^5.0.1" }, @@ -1059,6 +1060,32 @@ "dev": true, "license": "MIT" }, + "node_modules/@posthog/browser-common": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@posthog/browser-common/-/browser-common-0.10.1.tgz", + "integrity": "sha512-gKtBGEsjxNExO/19trnkiXTHFX0075vXn69zZ+lPlXy6P/DkED4644WqjDN/GIWr1Y5en2dcVJPOqUmVO+drkg==", + "license": "MIT", + "dependencies": { + "@posthog/core": "^1.61.1", + "@posthog/types": "^1.418.0", + "preact": "^10.29.3" + } + }, + "node_modules/@posthog/core": { + "version": "1.61.2", + "resolved": "https://registry.npmjs.org/@posthog/core/-/core-1.61.2.tgz", + "integrity": "sha512-l3b6Dc2NmItwmyu6ot7K2jtStQOAQjZw/PB/gpZwk2W6SBCbvPg6YJzReSBSQLuok19ridbfVNk70a5hgoGX2Q==", + "license": "MIT", + "dependencies": { + "@posthog/types": "^1.418.0" + } + }, + "node_modules/@posthog/types": { + "version": "1.418.0", + "resolved": "https://registry.npmjs.org/@posthog/types/-/types-1.418.0.tgz", + "integrity": "sha512-WqDXUWH1R8OilBp2PfDpQIRZSCs3QyOnw7H3YK7lvZLCMIsOqSZAKJrrqYWt4f7FvnVCACRuNGCC0HKh3J/HWw==", + "license": "MIT" + }, "node_modules/@rolldown/pluginutils": { "version": "1.0.0-rc.2", "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.2.tgz", @@ -1446,6 +1473,13 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", + "license": "MIT", + "optional": true + }, "node_modules/@unocss/astro": { "version": "0.65.4", "resolved": "https://registry.npmjs.org/@unocss/astro/-/astro-0.65.4.tgz", @@ -2483,6 +2517,20 @@ "url": "https://github.com/sponsors/mesqueeb" } }, + "node_modules/core-js": { + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.51.0.tgz", + "integrity": "sha512-7bDKx/5jm5MxzsXxc93g6Z2+4ZsuT/MddrfRmTDJNAkWsYWHU8EVNEsBiIEWnMAMCHMmRfUEjkuo3jeNBOIHRw==", + "hasInstallScript": true, + "license": "MIT", + "engines": { + "node": "*" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, "node_modules/css-tree": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-3.1.0.tgz", @@ -2585,6 +2633,15 @@ "dev": true, "license": "MIT" }, + "node_modules/dompurify": { + "version": "3.4.17", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.17.tgz", + "integrity": "sha512-B/pSlYVHQ58kqISD/yDjuJ1yfzI34m1gF4lAod2bwSRhiN4K5Cl3H8Af7hqB2PmTL911tdEudnnXn5FnhRoz0w==", + "license": "(MPL-2.0 OR Apache-2.0)", + "optionalDependencies": { + "@types/trusted-types": "^2.0.7" + } + }, "node_modules/duplexer": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", @@ -2702,6 +2759,12 @@ } } }, + "node_modules/fflate": { + "version": "0.4.9", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.4.9.tgz", + "integrity": "sha512-zdxgIEddhfsyCaWpJ2SdXEP8ZMrKJ6+5jl4OupODcywU0IhRk6gdXuVGcPICyfx2H97hVK7xmJtRLPjkxAX8Vw==", + "license": "MIT" + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -3307,6 +3370,54 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/posthog-js": { + "version": "1.441.2", + "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.441.2.tgz", + "integrity": "sha512-PsELSUSVCx80BfbtMtir8fW6scxVj+2CvsG+Vj2j9eTQYQL1AzsaZr73pqJk1XWEcSt+B1hEfirz3iFVQGVQkQ==", + "license": "(Apache-2.0 AND MIT)", + "dependencies": { + "@posthog/browser-common": "^0.10.1", + "@posthog/core": "^1.61.1", + "@posthog/types": "^1.418.0", + "core-js": "^3.49.0", + "dompurify": "^3.4.13", + "fflate": "^0.4.8", + "preact": "^10.29.3", + "query-selector-shadow-dom": "^1.0.1", + "web-vitals": "^6.2.1", + "web-vitals-soft-navs": "npm:web-vitals@6.2.1" + }, + "peerDependencies": { + "@types/react": ">=16.8.0", + "react": ">=16.8.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "react": { + "optional": true + } + } + }, + "node_modules/preact": { + "version": "10.29.8", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.29.8.tgz", + "integrity": "sha512-ej2aVZ+vZ8WO7tvlQWRM9N63A0KzF9q4mWJfDUHgYaIofWY9hu74QdnQrjoPMmZi2/nZ5gN0bJCQF49xQqx09Q==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + }, + "peerDependencies": { + "preact-render-to-string": ">=5" + }, + "peerDependenciesMeta": { + "preact-render-to-string": { + "optional": true + } + } + }, "node_modules/quansync": { "version": "0.2.11", "resolved": "https://registry.npmjs.org/quansync/-/quansync-0.2.11.tgz", @@ -3323,6 +3434,12 @@ ], "license": "MIT" }, + "node_modules/query-selector-shadow-dom": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/query-selector-shadow-dom/-/query-selector-shadow-dom-1.0.1.tgz", + "integrity": "sha512-lT5yCqEBgfoMYpf3F2xQRK7zEr1rhIIZuceDK6+xRkJQ4NMbHTwXqk4NkwDwQMNqXgG9r9fyHnzwNVs6zV5KRw==", + "license": "MIT" + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -4570,6 +4687,19 @@ "typescript": ">=5.0.0" } }, + "node_modules/web-vitals": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-6.2.3.tgz", + "integrity": "sha512-Dmy+vdO1UPMqXiAtZSNayhl4f794Bxfd94W4HIj2HlYtczEQfEOon969memlcpcHrTuOKLa5baFjX7WbgmOq+A==", + "license": "Apache-2.0" + }, + "node_modules/web-vitals-soft-navs": { + "name": "web-vitals", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-6.2.1.tgz", + "integrity": "sha512-rLcLXA2sx6+9dE88NHFubwTtGxpK4yYBLj6qHPdFoCaLr0cXGb4efOqtKLlm4loGA4OEKHIQKMKzZkKyOh5ctw==", + "license": "Apache-2.0" + }, "node_modules/webpack-virtual-modules": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.6.2.tgz", diff --git a/apps/basic-integration/vue/movies/package.json b/apps/basic-integration/vue/movies/package.json index 49e32caa3..c8f28385c 100644 --- a/apps/basic-integration/vue/movies/package.json +++ b/apps/basic-integration/vue/movies/package.json @@ -13,6 +13,7 @@ "lru-cache": "^10.2.0", "ohash": "^1.1.3", "pinia": "^3.0.4", + "posthog-js": "^1.441.2", "vue": "^3.5.27", "vue-router": "^5.0.1" }, diff --git a/apps/basic-integration/vue/movies/src/components/NavBar.vue b/apps/basic-integration/vue/movies/src/components/NavBar.vue index 6cb8edc3f..e99ca5f2a 100644 --- a/apps/basic-integration/vue/movies/src/components/NavBar.vue +++ b/apps/basic-integration/vue/movies/src/components/NavBar.vue @@ -1,13 +1,20 @@