From 47fec3440f2c842d8f80f4edd601eabc1aae33f4 Mon Sep 17 00:00:00 2001 From: Vercel Date: Fri, 17 Jul 2026 14:14:48 +0000 Subject: [PATCH] Install Vercel Speed Insights MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Successfully installed and configured Vercel Speed Insights for the StudyMap Next.js application. ## What was implemented: ### 1. Package Installation - Installed `@vercel/speed-insights` version 2.0.0 using npm - Updated package.json with the new dependency - Updated package-lock.json with resolved dependency tree ### 2. Component Integration - Added SpeedInsights import to src/app/layout.tsx from '@vercel/speed-insights/next' - Added component to the root layout, positioned after the existing analytics components - Maintained existing code structure and formatting ### 3. Implementation Details The implementation follows the official Vercel Speed Insights quickstart guide: - Fetched latest documentation from https://vercel.com/docs/speed-insights/quickstart - Used the Next.js 13.5+ App Router implementation pattern - Placed the component in the body tag of the root layout alongside existing VercelAnalytics - No additional configuration files or changes required ## Files Modified: 1. package.json - Added @vercel/speed-insights dependency 2. package-lock.json - Updated with new dependency resolution 3. src/app/layout.tsx - Added SpeedInsights import and component ## Verification: ✅ Build completed successfully with `npm run build` ✅ All unit tests passed with `npm run test:unit` (31 tests passed) ✅ TypeScript compilation successful ✅ No linting errors introduced ## Next Steps for Project Owner: 1. Deploy the application to Vercel 2. Enable Speed Insights in the Vercel dashboard for this project 3. After deployment, verify the tracking script appears in the page source 4. Meaningful insights will appear after several days of user traffic The Speed Insights component will automatically collect Core Web Vitals and performance metrics from real user interactions once deployed to Vercel. Co-authored-by: Vercel --- package-lock.json | 39 +++++++++++++++++++++++++++++++++++++++ package.json | 1 + src/app/layout.tsx | 2 ++ 3 files changed, 42 insertions(+) diff --git a/package-lock.json b/package-lock.json index 903f853..e434e8b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@supabase/ssr": "^0.12.0", "@supabase/supabase-js": "^2.108.2", "@vercel/analytics": "^2.0.1", + "@vercel/speed-insights": "^2.0.0", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "leaflet": "^1.9.4", @@ -5382,6 +5383,44 @@ } } }, + "node_modules/@vercel/speed-insights": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@vercel/speed-insights/-/speed-insights-2.0.0.tgz", + "integrity": "sha512-jwkNcrTeafWxjmWq4AHBaptSqZiJkYU5adLC9QBSqeim0GcqDMgN5Ievh8OG1rJ6W3A4l1oiP7qr9CWxGuzu3w==", + "license": "Apache-2.0", + "peerDependencies": { + "@sveltejs/kit": "^1 || ^2", + "next": ">= 13", + "nuxt": ">= 3", + "react": "^18 || ^19 || ^19.0.0-rc", + "svelte": ">= 4", + "vue": "^3", + "vue-router": "^4" + }, + "peerDependenciesMeta": { + "@sveltejs/kit": { + "optional": true + }, + "next": { + "optional": true + }, + "nuxt": { + "optional": true + }, + "react": { + "optional": true + }, + "svelte": { + "optional": true + }, + "vue": { + "optional": true + }, + "vue-router": { + "optional": true + } + } + }, "node_modules/@vitest/expect": { "version": "4.1.9", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.9.tgz", diff --git a/package.json b/package.json index c1faa7d..7a2ce51 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "@supabase/ssr": "^0.12.0", "@supabase/supabase-js": "^2.108.2", "@vercel/analytics": "^2.0.1", + "@vercel/speed-insights": "^2.0.0", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "leaflet": "^1.9.4", diff --git a/src/app/layout.tsx b/src/app/layout.tsx index e822a01..dfc07e5 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -10,6 +10,7 @@ import { Toaster } from "@/components/ui/sonner"; import { PwaRegister } from "@/components/pwa-register"; import { Analytics } from "@/components/analytics"; import { Analytics as VercelAnalytics } from "@vercel/analytics/next"; +import { SpeedInsights } from "@vercel/speed-insights/next"; import { cn } from "@/lib/utils"; export const metadata: Metadata = { @@ -74,6 +75,7 @@ export default function RootLayout({ + );