From 22036b16e960c42a3214dcef107c700a6894064c Mon Sep 17 00:00:00 2001 From: Vercel Date: Tue, 28 Jul 2026 19:30:53 +0000 Subject: [PATCH] Install Vercel Speed Insights with latest docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Vercel Speed Insights Installation Successfully installed and configured Vercel Speed Insights for the Next.js project following the official Vercel documentation. ### Changes Made: **1. Package Installation:** - Installed `@vercel/speed-insights` version 2.0.0 using npm - Updated `package.json` with the new dependency - Updated `package-lock.json` to lock dependency versions **2. Configuration:** - Modified `src/app/layout.tsx` to import and use the SpeedInsights component - Added import statement: `import { SpeedInsights } from "@vercel/speed-insights/react"` - Placed `` component at the end of the `` tag in the RootLayout ### Implementation Details: The implementation follows the official Vercel Speed Insights documentation from https://vercel.com/docs/speed-insights/quickstart Since the project uses Next.js with App Router and the root layout has "use client" directive, I used the React import path (`@vercel/speed-insights/react`) as recommended by the documentation for client components. The SpeedInsights component is placed at the bottom of the body tag to ensure it loads after the main content and doesn't block rendering. It will track Core Web Vitals metrics and performance data for all pages in the application. ### Verification: - ✅ Build completed successfully with no errors - ✅ Linter passed with no new errors or warnings - ✅ Dependencies properly installed and lock files updated - ✅ Code follows existing project structure and conventions ### Next Steps: Once deployed to Vercel, the Speed Insights dashboard will automatically begin collecting performance metrics. No additional configuration is required. Data will be available in the Vercel dashboard under the Speed Insights section. 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 bbf9106..c28ab91 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "@types/jsonwebtoken": "^9.0.10", "@types/qrcode.react": "^1.0.5", "@vercel/blob": "^2.4.0", + "@vercel/speed-insights": "^2.0.0", "bcrypt": "^6.0.0", "bcryptjs": "^3.0.2", "dotenv": "^17.2.2", @@ -2755,6 +2756,44 @@ "node": ">=20.0.0" } }, + "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/acorn": { "version": "8.15.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", diff --git a/package.json b/package.json index 0703911..1a786c9 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "@types/jsonwebtoken": "^9.0.10", "@types/qrcode.react": "^1.0.5", "@vercel/blob": "^2.4.0", + "@vercel/speed-insights": "^2.0.0", "bcrypt": "^6.0.0", "bcryptjs": "^3.0.2", "dotenv": "^17.2.2", diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 1d122a4..82eed7f 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -6,6 +6,7 @@ import Header from "./components/Header"; import Footer from "./components/Footer"; import FloatingWidgets from "./components/FloatingWidgets"; import { usePathname } from "next/navigation"; +import { SpeedInsights } from "@vercel/speed-insights/react"; const geistSans = Geist({ variable: "--font-geist-sans", @@ -85,6 +86,7 @@ export default function RootLayout({ {!isAdminPage &&