diff --git a/.gitignore b/.gitignore index 081664d..568dde4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ node_modules .next/ +.env.local .env* .DS_Store next-env.d.ts diff --git a/app/hooks/TrackPage.ts b/app/hooks/TrackPage.ts index e69de29..37f95d6 100644 --- a/app/hooks/TrackPage.ts +++ b/app/hooks/TrackPage.ts @@ -0,0 +1,34 @@ +"use client"; + +import { useEffect } from "react"; + +type TrackPageProps = { + page: string; +}; + +export default function useTrackPage({ page }: TrackPageProps) { + useEffect(() => { + const trackPage = async () => { + try { + await fetch("/api/track", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + event_type: "page_view", + payload: { + page, + url: window.location.href, + userAgent: navigator.userAgent, + }, + }), + }); + } catch (error) { + console.error("Page tracking failed:", error); + } + }; + + trackPage(); + }, [page]); +} \ No newline at end of file diff --git a/app/signup/page.tsx b/app/signup/page.tsx index f63ecd9..90b8bc7 100644 --- a/app/signup/page.tsx +++ b/app/signup/page.tsx @@ -1,8 +1,13 @@ +"use client"; + import Image from "next/image"; import EmailSignupForm from "./EmailSignupForm"; +import useTrackPage from "../hooks/TrackPage"; export default function SignupPage() { + useTrackPage({page:"signup"}); + return (
{/* Page content */} diff --git a/middleware.ts b/middleware.ts deleted file mode 100644 index e69de29..0000000 diff --git a/package-lock.json b/package-lock.json index ff66f2b..c0585f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "@playwright/test": "^1.49.0", "@radix-ui/react-label": "^2.1.8", "@radix-ui/react-slot": "^1.2.4", - "@supabase/supabase-js": "^2.97.0", + "@supabase/supabase-js": "^2.98.0", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "lucide-react": "^0.464.0", @@ -1080,9 +1080,9 @@ "license": "MIT" }, "node_modules/@supabase/auth-js": { - "version": "2.97.0", - "resolved": "https://registry.npmjs.org/@supabase/auth-js/-/auth-js-2.97.0.tgz", - "integrity": "sha512-2Og/1lqp+AIavr8qS2X04aSl8RBY06y4LrtIAGxat06XoXYiDxKNQMQzWDAKm1EyZFZVRNH48DO5YvIZ7la5fQ==", + "version": "2.98.0", + "resolved": "https://registry.npmjs.org/@supabase/auth-js/-/auth-js-2.98.0.tgz", + "integrity": "sha512-GBH361T0peHU91AQNzOlIrjUZw9TZbB9YDRiyFgk/3Kvr3/Z1NWUZ2athWTfHhwNNi8IrW00foyFxQD9IO/Trg==", "license": "MIT", "dependencies": { "tslib": "2.8.1" @@ -1092,9 +1092,9 @@ } }, "node_modules/@supabase/functions-js": { - "version": "2.97.0", - "resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.97.0.tgz", - "integrity": "sha512-fSaA0ZeBUS9hMgpGZt5shIZvfs3Mvx2ZdajQT4kv/whubqDBAp3GU5W8iIXy21MRvKmO2NpAj8/Q6y+ZkZyF/w==", + "version": "2.98.0", + "resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.98.0.tgz", + "integrity": "sha512-N/xEyiNU5Org+d+PNCpv+TWniAXRzxIURxDYsS/m2I/sfAB/HcM9aM2Dmf5edj5oWb9GxID1OBaZ8NMmPXL+Lg==", "license": "MIT", "dependencies": { "tslib": "2.8.1" @@ -1104,9 +1104,9 @@ } }, "node_modules/@supabase/postgrest-js": { - "version": "2.97.0", - "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-2.97.0.tgz", - "integrity": "sha512-g4Ps0eaxZZurvfv/KGoo2XPZNpyNtjth9aW8eho9LZWM0bUuBtxPZw3ZQ6ERSpEGogshR+XNgwlSPIwcuHCNww==", + "version": "2.98.0", + "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-2.98.0.tgz", + "integrity": "sha512-v6e9WeZuJijzUut8HyXu6gMqWFepIbaeaMIm1uKzei4yLg9bC9OtEW9O14LE/9ezqNbSAnSLO5GtOLFdm7Bpkg==", "license": "MIT", "dependencies": { "tslib": "2.8.1" @@ -1116,9 +1116,9 @@ } }, "node_modules/@supabase/realtime-js": { - "version": "2.97.0", - "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.97.0.tgz", - "integrity": "sha512-37Jw0NLaFP0CZd7qCan97D1zWutPrTSpgWxAw6Yok59JZoxp4IIKMrPeftJ3LZHmf+ILQOPy3i0pRDHM9FY36Q==", + "version": "2.98.0", + "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.98.0.tgz", + "integrity": "sha512-rOWt28uGyFipWOSd+n0WVMr9kUXiWaa7J4hvyLCIHjRFqWm1z9CaaKAoYyfYMC1Exn3WT8WePCgiVhlAtWC2yw==", "license": "MIT", "dependencies": { "@types/phoenix": "^1.6.6", @@ -1131,9 +1131,9 @@ } }, "node_modules/@supabase/storage-js": { - "version": "2.97.0", - "resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.97.0.tgz", - "integrity": "sha512-9f6NniSBfuMxOWKwEFb+RjJzkfMdJUwv9oHuFJKfe/5VJR8cd90qw68m6Hn0ImGtwG37TUO+QHtoOechxRJ1Yg==", + "version": "2.98.0", + "resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.98.0.tgz", + "integrity": "sha512-tzr2mG+v7ILSAZSfZMSL9OPyIH4z1ikgQ8EcQTKfMRz4EwmlFt3UnJaGzSOxyvF5b+fc9So7qdSUWTqGgeLokQ==", "license": "MIT", "dependencies": { "iceberg-js": "^0.8.1", @@ -1144,16 +1144,16 @@ } }, "node_modules/@supabase/supabase-js": { - "version": "2.97.0", - "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.97.0.tgz", - "integrity": "sha512-kTD91rZNO4LvRUHv4x3/4hNmsEd2ofkYhuba2VMUPRVef1RCmnHtm7rIws38Fg0yQnOSZOplQzafn0GSiy6GVg==", + "version": "2.98.0", + "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.98.0.tgz", + "integrity": "sha512-Ohc97CtInLwZyiSASz7tT9/Abm/vqnIbO9REp+PivVUII8UZsuI3bngRQnYgJdFoOIwvaEII1fX1qy8x0CyNiw==", "license": "MIT", "dependencies": { - "@supabase/auth-js": "2.97.0", - "@supabase/functions-js": "2.97.0", - "@supabase/postgrest-js": "2.97.0", - "@supabase/realtime-js": "2.97.0", - "@supabase/storage-js": "2.97.0" + "@supabase/auth-js": "2.98.0", + "@supabase/functions-js": "2.98.0", + "@supabase/postgrest-js": "2.98.0", + "@supabase/realtime-js": "2.98.0", + "@supabase/storage-js": "2.98.0" }, "engines": { "node": ">=20.0.0" diff --git a/package.json b/package.json index 26c4f99..a5f5b5a 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@playwright/test": "^1.49.0", "@radix-ui/react-label": "^2.1.8", "@radix-ui/react-slot": "^1.2.4", - "@supabase/supabase-js": "^2.97.0", + "@supabase/supabase-js": "^2.98.0", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "lucide-react": "^0.464.0",