From bfaa72952eea2823eb04ac654c6235525c35b114 Mon Sep 17 00:00:00 2001 From: Vercel Date: Thu, 27 Aug 2026 16:01:42 +0000 Subject: [PATCH] Install Vercel Speed Insights MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Vercel Speed Insights Implementation ## Summary Successfully installed and configured Vercel Speed Insights for the Astro project following the latest official documentation. ## Changes Made ### 1. Package Installation - Installed `@vercel/speed-insights@^2.0.0` package - Updated `package.json` to include the new dependency - Updated `package-lock.json` with the new package and its dependencies ### 2. Code Integration **Modified:** `src/components/Analytics.astro` - Added import statement: `import SpeedInsights from '@vercel/speed-insights/astro';` - Added the `` component to the template section alongside the existing `` component - Maintained all existing functionality including Google Analytics and custom event tracking ## Implementation Details The Speed Insights component was integrated into the existing Analytics.astro component, which is already included in the BaseLayout.astro and used across all pages. This ensures Speed Insights will track performance metrics site-wide. The implementation follows the official Vercel documentation for Astro projects: - Uses the framework-specific Astro component from `@vercel/speed-insights/astro` - Placed in the existing Analytics component for centralized analytics management - No additional configuration required - works automatically when deployed to Vercel ## Verification - ✅ Type checking passed with `astro check` - ✅ Build completed successfully with `npm run build` - ✅ No errors or build warnings introduced - ✅ All existing functionality preserved ## Next Steps Once deployed to Vercel: 1. Speed Insights will automatically begin collecting performance metrics 2. Data will be available in the Vercel Dashboard under Speed Insights 3. Metrics include First Contentful Paint (FCP), Largest Contentful Paint (LCP), Cumulative Layout Shift (CLS), and more Note: Speed Insights only tracks data in production environments, not during local development. Co-authored-by: Vercel --- package-lock.json | 141 +++++++++------------------------ package.json | 1 + src/components/Analytics.astro | 2 + 3 files changed, 42 insertions(+), 102 deletions(-) diff --git a/package-lock.json b/package-lock.json index 65ce353..5873881 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@astrojs/sitemap": "^3.7.3", "@astrojs/vercel": "^11.0.8", "@vercel/analytics": "^2.0.1", + "@vercel/speed-insights": "^2.0.0", "astro": "^7.2.7" }, "devDependencies": { @@ -107,9 +108,6 @@ "cpu": [ "arm64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -126,9 +124,6 @@ "cpu": [ "arm64" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -145,9 +140,6 @@ "cpu": [ "x64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -164,9 +156,6 @@ "cpu": [ "x64" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -451,9 +440,6 @@ "cpu": [ "arm64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -467,9 +453,6 @@ "cpu": [ "arm64" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -483,9 +466,6 @@ "cpu": [ "x64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -499,9 +479,6 @@ "cpu": [ "x64" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1246,9 +1223,6 @@ "cpu": [ "arm" ], - "libc": [ - "glibc" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1265,9 +1239,6 @@ "cpu": [ "arm64" ], - "libc": [ - "glibc" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1284,9 +1255,6 @@ "cpu": [ "ppc64" ], - "libc": [ - "glibc" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1303,9 +1271,6 @@ "cpu": [ "riscv64" ], - "libc": [ - "glibc" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1322,9 +1287,6 @@ "cpu": [ "s390x" ], - "libc": [ - "glibc" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1341,9 +1303,6 @@ "cpu": [ "x64" ], - "libc": [ - "glibc" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1360,9 +1319,6 @@ "cpu": [ "arm64" ], - "libc": [ - "musl" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1379,9 +1335,6 @@ "cpu": [ "x64" ], - "libc": [ - "musl" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1398,9 +1351,6 @@ "cpu": [ "arm" ], - "libc": [ - "glibc" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1423,9 +1373,6 @@ "cpu": [ "arm64" ], - "libc": [ - "glibc" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1448,9 +1395,6 @@ "cpu": [ "ppc64" ], - "libc": [ - "glibc" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1473,9 +1417,6 @@ "cpu": [ "riscv64" ], - "libc": [ - "glibc" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1498,9 +1439,6 @@ "cpu": [ "s390x" ], - "libc": [ - "glibc" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1523,9 +1461,6 @@ "cpu": [ "x64" ], - "libc": [ - "glibc" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1548,9 +1483,6 @@ "cpu": [ "arm64" ], - "libc": [ - "musl" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1573,9 +1505,6 @@ "cpu": [ "x64" ], - "libc": [ - "musl" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1861,9 +1790,6 @@ "cpu": [ "arm64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1880,9 +1806,6 @@ "cpu": [ "arm64" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1899,9 +1822,6 @@ "cpu": [ "ppc64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1918,9 +1838,6 @@ "cpu": [ "s390x" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1937,9 +1854,6 @@ "cpu": [ "x64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1956,9 +1870,6 @@ "cpu": [ "x64" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -2400,6 +2311,44 @@ "license": "MIT", "optional": true }, + "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/@volar/kit": { "version": "2.4.28", "resolved": "https://registry.npmjs.org/@volar/kit/-/kit-2.4.28.tgz", @@ -3949,9 +3898,6 @@ "cpu": [ "arm64" ], - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -3972,9 +3918,6 @@ "cpu": [ "arm64" ], - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -3995,9 +3938,6 @@ "cpu": [ "x64" ], - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -4018,9 +3958,6 @@ "cpu": [ "x64" ], - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ diff --git a/package.json b/package.json index 9c4938a..1368fb2 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "@astrojs/sitemap": "^3.7.3", "@astrojs/vercel": "^11.0.8", "@vercel/analytics": "^2.0.1", + "@vercel/speed-insights": "^2.0.0", "astro": "^7.2.7" }, "devDependencies": { diff --git a/src/components/Analytics.astro b/src/components/Analytics.astro index b6d206d..e4f3024 100644 --- a/src/components/Analytics.astro +++ b/src/components/Analytics.astro @@ -2,6 +2,7 @@ // Copyright 2026 OpenSourceOM // SPDX-License-Identifier: Apache-2.0 import VercelAnalytics from '@vercel/analytics/astro'; +import SpeedInsights from '@vercel/speed-insights/astro'; const gaId = import.meta.env.PUBLIC_GA_MEASUREMENT_ID ?? ''; --- @@ -23,6 +24,7 @@ const gaId = import.meta.env.PUBLIC_GA_MEASUREMENT_ID ?? ''; } +