From 74ebc524372731a3f4dca4dbace4d4e20e605386 Mon Sep 17 00:00:00 2001 From: Vercel Date: Fri, 13 Feb 2026 09:12:29 +0000 Subject: [PATCH] Install Vercel Speed Insights for Next.js ## Vercel Speed Insights Implementation Successfully installed and configured Vercel Speed Insights for this Next.js portfolio project. ### What was implemented: 1. **Installed @vercel/speed-insights package** - Used npm (the project's package manager) to install `@vercel/speed-insights` v1.3.1 - Updated package.json and package-lock.json with the new dependency 2. **Added SpeedInsights component to root layout** - Modified `app/layout.tsx` to import SpeedInsights from '@vercel/speed-insights/next' - Added the `` component inside the `` tag, after the main content - Placement follows Next.js App Router best practices for Next.js 15.5.12 ### Files Modified: - `app/layout.tsx` - Added import and component - `package.json` - Added @vercel/speed-insights dependency - `package-lock.json` - Updated with new dependency tree ### Implementation Details: - The project uses Next.js 15.5.12 with App Router, which is newer than 13.5+ - Used the simplified approach: imported from '@vercel/speed-insights/next' - No 'use client' directive needed as the package handles this internally - The component is placed at the end of the body tag for optimal performance ### Verification: - Build completed successfully with `npm run build` - No errors or warnings introduced - All changes have been staged with git The Speed Insights component will now automatically track Core Web Vitals and send analytics data to Vercel when deployed. Co-authored-by: Vercel --- app/layout.tsx | 2 ++ package-lock.json | 35 +++++++++++++++++++++++++++++++++++ package.json | 1 + 3 files changed, 38 insertions(+) diff --git a/app/layout.tsx b/app/layout.tsx index 391a640..523047b 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -6,6 +6,7 @@ import Header from "./components/Header"; import Image from "next/image"; import logo from "./logo.png" import Link from "next/link"; +import { SpeedInsights } from '@vercel/speed-insights/next'; export const metadata: Metadata = { title: "Portfolio - Mike Karl", @@ -34,6 +35,7 @@ export default function RootLayout({ {children}
+ ); diff --git a/package-lock.json b/package-lock.json index 7405ee2..83c71f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "portfolio", "version": "0.1.0", "dependencies": { + "@vercel/speed-insights": "^1.3.1", "framer-motion": "^12.33.0", "next": "^15.5.12", "react": "19.1.0", @@ -1045,6 +1046,40 @@ "@types/react": "^19.2.0" } }, + "node_modules/@vercel/speed-insights": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vercel/speed-insights/-/speed-insights-1.3.1.tgz", + "integrity": "sha512-PbEr7FrMkUrGYvlcLHGkXdCkxnylCWePx7lPxxq36DNdfo9mcUjLOmqOyPDHAOgnfqgGGdmE3XI9L/4+5fr+vQ==", + "license": "Apache-2.0", + "peerDependencies": { + "@sveltejs/kit": "^1 || ^2", + "next": ">= 13", + "react": "^18 || ^19 || ^19.0.0-rc", + "svelte": ">= 4", + "vue": "^3", + "vue-router": "^4" + }, + "peerDependenciesMeta": { + "@sveltejs/kit": { + "optional": true + }, + "next": { + "optional": true + }, + "react": { + "optional": true + }, + "svelte": { + "optional": true + }, + "vue": { + "optional": true + }, + "vue-router": { + "optional": true + } + } + }, "node_modules/caniuse-lite": { "version": "1.0.30001751", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001751.tgz", diff --git a/package.json b/package.json index dc1d6a4..a390138 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "start": "next start" }, "dependencies": { + "@vercel/speed-insights": "^1.3.1", "framer-motion": "^12.33.0", "next": "^15.5.12", "react": "19.1.0",