Skip to content

Install and configure Vercel Speed Insights - #6

Merged
maazghani merged 1 commit into
mainfrom
vercel/install-and-configure-vercel-s-bxcu6j
Aug 4, 2026
Merged

maazghani merged 1 commit into
mainfrom
vercel/install-and-configure-vercel-s-bxcu6j

Conversation

@vercel

@vercel vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Vercel Speed Insights Installation

Successfully installed and configured Vercel Speed Insights for this Next.js project.

Changes Made

1. Package Installation

  • Installed @vercel/speed-insights version 2.0.0 using pnpm
  • Package added to dependencies in package.json
  • Updated pnpm-lock.yaml with new dependency tree

2. Code Integration

Modified app/layout.tsx:

  • Imported SpeedInsights component from @vercel/speed-insights/next
  • Added <SpeedInsights /> component to the root layout's body
  • Configured to only render in production environment (matching existing Analytics pattern)
  • Placed alongside the existing Vercel Analytics component

Implementation Details

The implementation follows the official Vercel Speed Insights documentation for Next.js App Router (v13.5+):

  • Used the framework-specific import path: @vercel/speed-insights/next
  • Added the component to the root layout file for global coverage
  • Applied conditional rendering based on NODE_ENV to avoid running in development

Verification

✅ Build Status: Build completed successfully with no errors
✅ Tests: All 48 tests passed across 4 test files
✅ TypeScript: No type errors (build includes TypeScript validation)

Files Modified

  • app/layout.tsx - Added SpeedInsights import and component
  • package.json - Added @vercel/speed-insights dependency
  • pnpm-lock.yaml - Updated lockfile with new dependencies

Next Steps

To enable Speed Insights in production:

  1. Deploy the application to Vercel
  2. Navigate to Speed Insights in the Vercel dashboard
  3. Click "Enable" to activate data collection
  4. The script will automatically start collecting performance metrics

The SpeedInsights component will only be active in production builds and will not affect development or local testing.


View Project · Speed Insights

Created by Maaz Ghani (maazg) with Vercel Agent

# Vercel Speed Insights Installation

Successfully installed and configured Vercel Speed Insights for this Next.js project.

## Changes Made

### 1. Package Installation
- Installed `@vercel/speed-insights` version 2.0.0 using pnpm
- Package added to dependencies in `package.json`
- Updated `pnpm-lock.yaml` with new dependency tree

### 2. Code Integration
Modified `app/layout.tsx`:
- Imported `SpeedInsights` component from `@vercel/speed-insights/next`
- Added `<SpeedInsights />` component to the root layout's body
- Configured to only render in production environment (matching existing Analytics pattern)
- Placed alongside the existing Vercel Analytics component

## Implementation Details

The implementation follows the official Vercel Speed Insights documentation for Next.js App Router (v13.5+):
- Used the framework-specific import path: `@vercel/speed-insights/next`
- Added the component to the root layout file for global coverage
- Applied conditional rendering based on NODE_ENV to avoid running in development

## Verification

✅ **Build Status**: Build completed successfully with no errors
✅ **Tests**: All 48 tests passed across 4 test files
✅ **TypeScript**: No type errors (build includes TypeScript validation)

## Files Modified

- `app/layout.tsx` - Added SpeedInsights import and component
- `package.json` - Added @vercel/speed-insights dependency
- `pnpm-lock.yaml` - Updated lockfile with new dependencies

## Next Steps

To enable Speed Insights in production:
1. Deploy the application to Vercel
2. Navigate to Speed Insights in the Vercel dashboard
3. Click "Enable" to activate data collection
4. The script will automatically start collecting performance metrics

The SpeedInsights component will only be active in production builds and will not affect development or local testing.

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

vercel Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor Author

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

Project Deployment Actions Updated (UTC)
git-to Ready Ready Preview, v0 Aug 4, 2026 8:55pm

@maazghani
maazghani marked this pull request as ready for review August 4, 2026 20:55
@maazghani
maazghani merged commit 16bea56 into main Aug 4, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview — 1796ad3a Deployed Aug 4, 2026 by vercel[bot]
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.

1 participant