Skip to content

Commit

Permalink
feat: ✨ Added Vercel Analytics
Browse files Browse the repository at this point in the history
- Updated .env.example and env.mjs
  • Loading branch information
adevinwild committed Mar 21, 2024
1 parent 1bb7d6c commit ea540e3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
## Thoses variables will be checked on runtime, if they are not set, the application will throw an error.
## src/env.mjs

# Vercel configuration
SITE_URL=""


# Supabase configuration
## Supabase URL
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@supabase/ssr": "^0.1.0",
"@supabase/supabase-js": "^2.39.8",
"@t3-oss/env-nextjs": "^0.9.2",
"@vercel/analytics": "^1.2.2",
"cal-sans": "^1.0.1",
"chalk": "^5.3.0",
"class-variance-authority": "^0.7.0",
Expand Down
2 changes: 2 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import "./globals.css";

import type { Metadata } from "next";
import { Inter } from "next/font/google";
import { Analytics } from "@vercel/analytics/react";
import { Toaster } from "sonner";

import { Avatar, AvatarImage } from "@/components/ui/avatar";
Expand Down Expand Up @@ -55,6 +56,7 @@ export default function RootLayout({
<html lang="en">
<body className={cn("antialiased flex flex-col", inter.className)}>
<Toaster />
<Analytics />
<main className="w-full max-w-7xl mx-auto mb-20 grow h-full">
<Navbar />
{children}
Expand Down
2 changes: 2 additions & 0 deletions src/env.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const env = createEnv({
NGROK_URL: z.string().url().optional(),
STRIPE_SECRET_KEY: z.string().min(1),
STRIPE_WEBHOOK_SECRET: z.string().min(1),
SITE_URL: z.string().url(),
},
clientPrefix: "NEXT_PUBLIC_",
client: {
Expand All @@ -27,5 +28,6 @@ export const env = createEnv({
NGROK_URL: process.env.NGROK_URL,
STRIPE_SECRET_KEY: process.env.STRIPE_SECRET_KEY,
STRIPE_WEBHOOK_SECRET: process.env.STRIPE_WEBHOOK_SECRET,
SITE_URL: process.env.SITE_URL,
},
});
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,13 @@
resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406"
integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==

"@vercel/analytics@^1.2.2":
version "1.2.2"
resolved "https://registry.yarnpkg.com/@vercel/analytics/-/analytics-1.2.2.tgz#715d8f203a170c06ba36b363e03b048c03060d5d"
integrity sha512-X0rctVWkQV1e5Y300ehVNqpOfSOufo7ieA5PIdna8yX/U7Vjz0GFsGf4qvAhxV02uQ2CVt7GYcrFfddXXK2Y4A==
dependencies:
server-only "^0.0.1"

abort-controller@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392"
Expand Down

0 comments on commit ea540e3

Please sign in to comment.