Skip to content

Commit 7179830

Browse files
author
Marvin Zhang
committed
feat(ui): add Vercel Analytics integration for tracking on web.lean-spec.dev
1 parent 321aca9 commit 7179830

File tree

4 files changed

+39
-1
lines changed

4 files changed

+39
-1
lines changed

docs-site

packages/ui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"@radix-ui/react-slot": "^1.2.4",
6565
"@radix-ui/react-tabs": "^1.1.13",
6666
"@radix-ui/react-tooltip": "^1.2.8",
67+
"@vercel/analytics": "^1.5.0",
6768
"better-sqlite3": "^11.7.0",
6869
"chalk": "^5.3.0",
6970
"class-variance-authority": "^0.7.1",

packages/ui/src/app/layout.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { ThemeProvider } from "@/components/theme-provider";
66
import { Toast } from "@/components/ui/toast";
77
import { ProjectProvider } from "@/contexts/project-context";
88
import { getSpecs } from "@/lib/db/service-queries";
9+
import { Analytics } from "@vercel/analytics/react";
910

1011
export const metadata: Metadata = {
1112
title: "LeanSpec Web - Interactive Spec Showcase",
@@ -68,6 +69,8 @@ export default async function RootLayout({
6869
<Toast />
6970
</ProjectProvider>
7071
</ThemeProvider>
72+
{/* Only track analytics on web.lean-spec.dev, not for other users */}
73+
{process.env.NEXT_PUBLIC_VERCEL_URL?.includes('lean-spec.dev') && <Analytics />}
7174
</body>
7275
</html>
7376
);

pnpm-lock.yaml

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)