Skip to content

Install Vercel Speed Insights for Next.js#1

Draft
vercel[bot] wants to merge 1 commit intomainfrom
vercel/install-vercel-speed-insights-gddrfb
Draft

Install Vercel Speed Insights for Next.js#1
vercel[bot] wants to merge 1 commit intomainfrom
vercel/install-vercel-speed-insights-gddrfb

Conversation

@vercel
Copy link

@vercel vercel bot commented Dec 5, 2025

Vercel Speed Insights Integration

Successfully installed and configured Vercel Speed Insights for this Next.js 16.0.7 project with App Router.

Changes Made:

  1. Package Installation:

    • Installed @vercel/speed-insights version 1.3.1
    • Updated package.json with the new dependency
    • Updated package-lock.json with resolved dependencies
  2. Root Layout Integration (src/app/layout.tsx):

    • Added import: import { SpeedInsights } from "@vercel/speed-insights/next"
    • Added <SpeedInsights /> component inside the <body> tag, after the ThemeProvider
    • Placement follows Next.js App Router best practices for Next.js 13.5+
  3. Build Artifacts:

    • Updated public/sw.js (service worker) as a result of the production build

Implementation Details:

Since this project uses Next.js 16.0.7 with App Router (which is newer than 13.5), I used the standard Next.js integration:

  • Imported from @vercel/speed-insights/next (not React)
  • No need for 'use client' directive or usePathname() hook
  • Component automatically handles route tracking

The SpeedInsights component is now positioned at the root level, ensuring it tracks all page navigations throughout the application.

Verification:

✅ Production build completed successfully
✅ All 860 tests passed
✅ No new linting errors introduced (pre-existing linting issues remain unchanged)
✅ Lock files updated correctly

The integration is complete and ready for deployment. Speed Insights will automatically collect and report performance metrics when deployed to Vercel.


Vercel Project · Speed Insights

Created by odnamta with Vercel Agent

## Vercel Speed Insights Integration

Successfully installed and configured Vercel Speed Insights for this Next.js 16.0.7 project with App Router.

### Changes Made:

1. **Package Installation:**
   - Installed `@vercel/speed-insights` version 1.3.1
   - Updated `package.json` with the new dependency
   - Updated `package-lock.json` with resolved dependencies

2. **Root Layout Integration (src/app/layout.tsx):**
   - Added import: `import { SpeedInsights } from "@vercel/speed-insights/next"`
   - Added `<SpeedInsights />` component inside the `<body>` tag, after the ThemeProvider
   - Placement follows Next.js App Router best practices for Next.js 13.5+

3. **Build Artifacts:**
   - Updated `public/sw.js` (service worker) as a result of the production build

### Implementation Details:

Since this project uses Next.js 16.0.7 with App Router (which is newer than 13.5), I used the standard Next.js integration:
- Imported from `@vercel/speed-insights/next` (not React)
- No need for 'use client' directive or usePathname() hook
- Component automatically handles route tracking

The SpeedInsights component is now positioned at the root level, ensuring it tracks all page navigations throughout the application.

### Verification:

✅ Production build completed successfully
✅ All 860 tests passed
✅ No new linting errors introduced (pre-existing linting issues remain unchanged)
✅ Lock files updated correctly

The integration is complete and ready for deployment. Speed Insights will automatically collect and report performance metrics when deployed to Vercel.

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
@vercel
Copy link
Author

vercel bot commented Dec 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
celline-obgyn-prep Ready Ready Preview Comment Dec 5, 2025 0:34am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants