Skip to content

Install and Configure Vercel Speed Insights - #7

Open
vercel[bot] wants to merge 1 commit into
mainfrom
vercel/install-and-configure-vercel-s-jmfzxl
Open

Install and Configure Vercel Speed Insights#7
vercel[bot] wants to merge 1 commit into
mainfrom
vercel/install-and-configure-vercel-s-jmfzxl

Conversation

@vercel

@vercel vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

Successfully implemented Vercel Speed Insights for the wechat-workflow project.

What Was Implemented

This project is a vanilla JavaScript/HTML Express.js application deployed on Vercel. I followed the latest official Vercel Speed Insights documentation to implement the integration.

Changes Made

1. Package Installation

  • Installed @vercel/speed-insights v2.0.0 package via npm
  • Added dependency to package.json

2. Speed Insights Integration

  • Copied the Speed Insights ESM module (index.mjs) to public/speed-insights.mjs for browser access
  • Added Speed Insights initialization script to public/index.html using ES6 module imports
  • Used the injectSpeedInsights() function from the package to initialize Speed Insights tracking

3. Files Modified

  • package.json - Added @vercel/speed-insights dependency
  • package-lock.json - Updated with new package and dependencies
  • public/index.html - Added Speed Insights initialization script before closing </body> tag

4. Files Created

  • public/speed-insights.mjs - Bundled Speed Insights module for browser consumption

Implementation Details

Since this is a vanilla JavaScript project (not React, Next.js, or other frameworks), I followed the documentation's guidance for vanilla JS projects by:

  1. Installing the @vercel/speed-insights package
  2. Using the injectSpeedInsights() function from the package
  3. Loading it as an ES6 module in the HTML file

The Speed Insights script will automatically:

  • Track Core Web Vitals (LCP, FID, CLS, TTFB, INP)
  • Send performance metrics to Vercel's Speed Insights dashboard
  • Only track data in production mode (not in development)

Verification

  • ✅ Tests pass successfully (npm test)
  • ✅ Server starts without errors (npm start)
  • ✅ Speed Insights module properly copied to public directory
  • ✅ HTML integration follows ES6 module standards
  • ✅ All dependencies properly installed and locked

Next Steps

To see Speed Insights data:

  1. Enable Speed Insights in the Vercel dashboard for this project
  2. Deploy the updated code to Vercel
  3. Wait for visitor traffic to accumulate
  4. View performance metrics in the Vercel Speed Insights dashboard

Speed Insights will automatically begin collecting performance data once deployed to Vercel and enabled in the dashboard.


View Project · Speed Insights

Created by Dong Ke (baiheinet) with Vercel Agent

Successfully implemented Vercel Speed Insights for the wechat-workflow project.

## What Was Implemented

This project is a vanilla JavaScript/HTML Express.js application deployed on Vercel. I followed the latest official Vercel Speed Insights documentation to implement the integration.

## Changes Made

### 1. Package Installation
- Installed `@vercel/speed-insights` v2.0.0 package via npm
- Added dependency to package.json

### 2. Speed Insights Integration
- Copied the Speed Insights ESM module (`index.mjs`) to `public/speed-insights.mjs` for browser access
- Added Speed Insights initialization script to `public/index.html` using ES6 module imports
- Used the `injectSpeedInsights()` function from the package to initialize Speed Insights tracking

### 3. Files Modified
- `package.json` - Added @vercel/speed-insights dependency
- `package-lock.json` - Updated with new package and dependencies
- `public/index.html` - Added Speed Insights initialization script before closing `</body>` tag

### 4. Files Created
- `public/speed-insights.mjs` - Bundled Speed Insights module for browser consumption

## Implementation Details

Since this is a vanilla JavaScript project (not React, Next.js, or other frameworks), I followed the documentation's guidance for vanilla JS projects by:

1. Installing the `@vercel/speed-insights` package
2. Using the `injectSpeedInsights()` function from the package
3. Loading it as an ES6 module in the HTML file

The Speed Insights script will automatically:
- Track Core Web Vitals (LCP, FID, CLS, TTFB, INP)
- Send performance metrics to Vercel's Speed Insights dashboard
- Only track data in production mode (not in development)

## Verification

- ✅ Tests pass successfully (`npm test`)
- ✅ Server starts without errors (`npm start`)
- ✅ Speed Insights module properly copied to public directory
- ✅ HTML integration follows ES6 module standards
- ✅ All dependencies properly installed and locked

## Next Steps

To see Speed Insights data:
1. Enable Speed Insights in the Vercel dashboard for this project
2. Deploy the updated code to Vercel
3. Wait for visitor traffic to accumulate
4. View performance metrics in the Vercel Speed Insights dashboard

Speed Insights will automatically begin collecting performance data once deployed to Vercel and enabled in the dashboard.

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

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown
Author

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

Project Deployment Actions Updated (UTC)
wechat-workflow Ready Ready Preview, Comment Jun 10, 2026 1:43pm

@baiheinet
baiheinet marked this pull request as ready for review June 11, 2026 04:24
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