Skip to content

Commit 7fc8693

Browse files
committed
Add Vercel Speed Insights to Next.js
Implemented Vercel Speed Insights integration for Next.js WHAT WAS IMPLEMENTED: Successfully installed and configured Vercel Speed Insights for the CodeStorm Hub Next.js project (version 15.5.9 with App Router). CHANGES MADE: 1. Package Installation - Installed @vercel/speed-insights@^1.3.1 via npm - Updated package.json with new dependency - Updated package-lock.json to lock dependency versions 2. Root Layout Configuration (src/app/layout.tsx) - Added import: `import { SpeedInsights } from "@vercel/speed-insights/next";` - Added `<SpeedInsights />` component inside the <body> tag, positioned after the Analytics component - Component placement ensures it can track Core Web Vitals and other performance metrics IMPLEMENTATION DETAILS: - Used the '@vercel/speed-insights/next' import (appropriate for Next.js 13.5+ with App Router) - Placed the SpeedInsights component within the body tag as recommended, after the existing Analytics component - Maintained existing code structure and preserved all other functionality - No changes required to existing components or configuration VERIFICATION COMPLETED: ✓ Type checking passed (npm run type-check) ✓ Linting passed (npm run lint) ✓ Production build successful (npm run build) - all 22 pages generated successfully ✓ No errors or warnings introduced NOTES: - The project already had Vercel Analytics (@vercel/analytics) installed, so the Speed Insights integration complements the existing monitoring setup - Speed Insights will automatically collect performance data and send it to the Vercel dashboard - The component is production-ready and requires no additional configuration Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
1 parent a41fc87 commit 7fc8693

3 files changed

Lines changed: 38 additions & 0 deletions

File tree

package-lock.json

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"@radix-ui/react-slot": "^1.2.3",
2020
"@radix-ui/react-toast": "^1.2.15",
2121
"@vercel/analytics": "^1.6.1",
22+
"@vercel/speed-insights": "^1.3.1",
2223
"class-variance-authority": "^0.7.1",
2324
"clsx": "^2.1.1",
2425
"gray-matter": "^4.0.3",

src/app/layout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { Metadata } from "next";
22
import { Geist, Geist_Mono } from "next/font/google";
33
import "./globals.css";
44
import { Analytics } from "@vercel/analytics/next";
5+
import { SpeedInsights } from "@vercel/speed-insights/next";
56
import { Header } from "@/components/layout/header";
67
import { Footer } from "@/components/layout/footer";
78
import { SkipLinks } from "@/components/ui/skip-links";
@@ -66,6 +67,7 @@ export default function RootLayout({
6667
</div>
6768
</ThemeProvider>
6869
<Analytics />
70+
<SpeedInsights />
6971
</body>
7072
</html>
7173
);

0 commit comments

Comments
 (0)