Skip to content

Add Vercel Speed Insights integration#28

Draft
vercel[bot] wants to merge 1 commit into
masterfrom
vercel/vercel-speed-insights-integrat-zi4iet
Draft

Add Vercel Speed Insights integration#28
vercel[bot] wants to merge 1 commit into
masterfrom
vercel/vercel-speed-insights-integrat-zi4iet

Conversation

@vercel

@vercel vercel Bot commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Vercel Speed Insights Installation Report

Summary

Successfully configured Vercel Speed Insights for this Next.js project. The Speed Insights component was already properly integrated in the codebase, but dependencies needed to be installed and a missing dependency (jose) was added to fix build issues.

What Was Done

1. Fetched Latest Documentation

2. Verified Existing Configuration

  • Package Installation: Confirmed @vercel/speed-insights@^2.0.0 was already listed in package.json
  • Component Integration: Verified SpeedInsights component from @vercel/speed-insights/next was already properly imported and added to src/app/layout.tsx
  • The integration follows Next.js App Router best practices by placing the component at the end of the root layout's <body> tag

3. Dependency Management

  • Installed all project dependencies using pnpm install
  • Identified and fixed missing jose package dependency (required by src/lib/auth/apple-secret.ts)
  • Added jose@^6.2.2 to dependencies

4. Verification Steps

  • ✅ Build completed successfully with pnpm build
  • ✅ All linting checks passed with pnpm lint
  • ✅ All 113 tests passed across 7 test files with pnpm test
  • ✅ No build artifacts or cache files included in the commit

Files Modified

package.json

  • Added jose@^6.2.2 to dependencies (was missing but required by existing code)

pnpm-lock.yaml

  • Updated lock file with all installed dependencies including @vercel/speed-insights@2.0.0 and jose@6.2.2

Implementation Details

The Speed Insights integration in src/app/layout.tsx follows the official Next.js App Router pattern:

import { SpeedInsights } from "@vercel/speed-insights/next"

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en" suppressHydrationWarning>
      <body className={`${inter.className} antialiased`}>
        <AuthProvider>
          {children}
        </AuthProvider>
        <Toaster />
        <SpeedInsights />
      </body>
    </html>
  )
}

This placement ensures Speed Insights tracks all page navigations and performance metrics across the application.

Next Steps

To enable Speed Insights on Vercel:

  1. Navigate to your Vercel project dashboard
  2. Go to Speed Insights settings
  3. Click "Enable" to activate Speed Insights tracking
  4. Deploy this code to see metrics after user visits

Notes

  • The project uses pnpm as the package manager (lockfile version 9.0)
  • Speed Insights will automatically track Core Web Vitals (LCP, FID, CLS, etc.)
  • No additional configuration or environment variables are required
  • The component is lightweight and has minimal performance impact

View Project · Speed Insights

Created by trademomentumllc with Vercel Agent

# Vercel Speed Insights Installation Report

## Summary
Successfully configured Vercel Speed Insights for this Next.js project. The Speed Insights component was already properly integrated in the codebase, but dependencies needed to be installed and a missing dependency (`jose`) was added to fix build issues.

## What Was Done

### 1. Fetched Latest Documentation
- Retrieved the latest installation instructions from https://vercel.com/docs/speed-insights/quickstart
- Verified framework-specific instructions for Next.js App Router

### 2. Verified Existing Configuration
- **Package Installation**: Confirmed `@vercel/speed-insights@^2.0.0` was already listed in package.json
- **Component Integration**: Verified `SpeedInsights` component from `@vercel/speed-insights/next` was already properly imported and added to `src/app/layout.tsx`
- The integration follows Next.js App Router best practices by placing the component at the end of the root layout's `<body>` tag

### 3. Dependency Management
- Installed all project dependencies using `pnpm install`
- Identified and fixed missing `jose` package dependency (required by `src/lib/auth/apple-secret.ts`)
- Added `jose@^6.2.2` to dependencies

### 4. Verification Steps
- ✅ Build completed successfully with `pnpm build`
- ✅ All linting checks passed with `pnpm lint`
- ✅ All 113 tests passed across 7 test files with `pnpm test`
- ✅ No build artifacts or cache files included in the commit

## Files Modified

### package.json
- Added `jose@^6.2.2` to dependencies (was missing but required by existing code)

### pnpm-lock.yaml
- Updated lock file with all installed dependencies including `@vercel/speed-insights@2.0.0` and `jose@6.2.2`

## Implementation Details

The Speed Insights integration in `src/app/layout.tsx` follows the official Next.js App Router pattern:

```typescript
import { SpeedInsights } from "@vercel/speed-insights/next"

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en" suppressHydrationWarning>
      <body className={`${inter.className} antialiased`}>
        <AuthProvider>
          {children}
        </AuthProvider>
        <Toaster />
        <SpeedInsights />
      </body>
    </html>
  )
}
```

This placement ensures Speed Insights tracks all page navigations and performance metrics across the application.

## Next Steps

To enable Speed Insights on Vercel:
1. Navigate to your Vercel project dashboard
2. Go to Speed Insights settings
3. Click "Enable" to activate Speed Insights tracking
4. Deploy this code to see metrics after user visits

## Notes

- The project uses pnpm as the package manager (lockfile version 9.0)
- Speed Insights will automatically track Core Web Vitals (LCP, FID, CLS, etc.)
- No additional configuration or environment variables are required
- The component is lightweight and has minimal performance impact

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

vercel Bot commented Mar 23, 2026

Copy link
Copy Markdown
Contributor Author

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

Project Deployment Actions Updated (UTC)
ihep-app Error Error Mar 23, 2026 8:37pm

Request Review

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