Install and Configure Vercel Speed Insights - #7
Open
vercel[bot] wants to merge 1 commit into
Open
Conversation
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>
Author
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
baiheinet
marked this pull request as ready for review
June 11, 2026 04:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
@vercel/speed-insightsv2.0.0 package via npm2. Speed Insights Integration
index.mjs) topublic/speed-insights.mjsfor browser accesspublic/index.htmlusing ES6 module importsinjectSpeedInsights()function from the package to initialize Speed Insights tracking3. Files Modified
package.json- Added @vercel/speed-insights dependencypackage-lock.json- Updated with new package and dependenciespublic/index.html- Added Speed Insights initialization script before closing</body>tag4. Files Created
public/speed-insights.mjs- Bundled Speed Insights module for browser consumptionImplementation 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:
@vercel/speed-insightspackageinjectSpeedInsights()function from the packageThe Speed Insights script will automatically:
Verification
npm test)npm start)Next Steps
To see Speed Insights data:
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