Skip to content

Install Vercel Speed Insights#1

Draft
vercel[bot] wants to merge 1 commit into
mainfrom
vercel/install-vercel-speed-insights-76hw9a
Draft

Install Vercel Speed Insights#1
vercel[bot] wants to merge 1 commit into
mainfrom
vercel/install-vercel-speed-insights-76hw9a

Conversation

@vercel

@vercel vercel Bot commented Apr 11, 2026

Copy link
Copy Markdown

Vercel Speed Insights Implementation

Successfully installed and configured Vercel Speed Insights for the advisory-engine project.

Changes Made:

1. Package Installation

  • Installed @vercel/speed-insights version 2.0.0
  • Added package to package.json dependencies
  • Generated package-lock.json with all dependencies locked

2. Speed Insights Integration

  • Added Speed Insights tracking script to public/index.html
  • Implementation follows Vercel's official documentation for vanilla HTML/JavaScript projects
  • Added two script tags before closing </body> tag:
    1. Initialization script to set up the window.si queue function
    2. Deferred loading of the Speed Insights script from /_vercel/speed-insights/script.js

Implementation Details:

Framework Identified: Vanilla HTML/JavaScript with Vercel Serverless Functions

Method Used: Manual script injection (official method for static HTML sites)

The implementation uses the recommended approach from Vercel's documentation:

<script>
  window.si = window.si || function () { (window.siq = window.siq || []).push(arguments); };
</script>
<script defer src="/_vercel/speed-insights/script.js"></script>

This approach:

  • Initializes the Speed Insights queue before the main script loads
  • Uses deferred loading to avoid blocking page rendering
  • Loads the script from Vercel's CDN path which is automatically available when deployed
  • Will only track metrics in production (not in development)

Files Modified:

  1. package.json

    • Added @vercel/speed-insights dependency
  2. public/index.html

    • Added Speed Insights script tags before closing </body> tag
    • Placed after all other scripts to ensure proper page loading
  3. package-lock.json (generated)

    • Locked all dependency versions for consistent installs

Verification:

  • No build errors (project uses static HTML, no build step required)
  • No linter/test suite configured in project (verified)
  • HTML syntax validated and properly formatted
  • Speed Insights will activate automatically when deployed to Vercel

Next Steps (for the developer):

  1. Deploy the changes to Vercel
  2. Enable Speed Insights in the Vercel Dashboard (Settings → Speed Insights)
  3. After deployment and user traffic, performance data will appear in the Speed Insights dashboard
  4. Data typically appears within a few days of deployment

Notes:

  • Speed Insights does NOT track data in development mode
  • The script is loaded asynchronously and will not impact page performance
  • The /_vercel/speed-insights/script.js path is automatically available on Vercel's infrastructure
  • No additional configuration is required for basic usage

View Project · Speed Insights

Created by 8in (8in) with Vercel Agent

## Vercel Speed Insights Implementation

Successfully installed and configured Vercel Speed Insights for the advisory-engine project.

### Changes Made:

#### 1. Package Installation
- Installed `@vercel/speed-insights` version 2.0.0
- Added package to `package.json` dependencies
- Generated `package-lock.json` with all dependencies locked

#### 2. Speed Insights Integration
- Added Speed Insights tracking script to `public/index.html`
- Implementation follows Vercel's official documentation for vanilla HTML/JavaScript projects
- Added two script tags before closing `</body>` tag:
  1. Initialization script to set up the `window.si` queue function
  2. Deferred loading of the Speed Insights script from `/_vercel/speed-insights/script.js`

### Implementation Details:

**Framework Identified:** Vanilla HTML/JavaScript with Vercel Serverless Functions

**Method Used:** Manual script injection (official method for static HTML sites)

The implementation uses the recommended approach from Vercel's documentation:
```html
<script>
  window.si = window.si || function () { (window.siq = window.siq || []).push(arguments); };
</script>
<script defer src="/_vercel/speed-insights/script.js"></script>
```

This approach:
- Initializes the Speed Insights queue before the main script loads
- Uses deferred loading to avoid blocking page rendering
- Loads the script from Vercel's CDN path which is automatically available when deployed
- Will only track metrics in production (not in development)

### Files Modified:

1. **package.json**
   - Added `@vercel/speed-insights` dependency

2. **public/index.html**
   - Added Speed Insights script tags before closing `</body>` tag
   - Placed after all other scripts to ensure proper page loading

3. **package-lock.json** (generated)
   - Locked all dependency versions for consistent installs

### Verification:

- No build errors (project uses static HTML, no build step required)
- No linter/test suite configured in project (verified)
- HTML syntax validated and properly formatted
- Speed Insights will activate automatically when deployed to Vercel

### Next Steps (for the developer):

1. Deploy the changes to Vercel
2. Enable Speed Insights in the Vercel Dashboard (Settings → Speed Insights)
3. After deployment and user traffic, performance data will appear in the Speed Insights dashboard
4. Data typically appears within a few days of deployment

### Notes:

- Speed Insights does NOT track data in development mode
- The script is loaded asynchronously and will not impact page performance
- The `/_vercel/speed-insights/script.js` path is automatically available on Vercel's infrastructure
- No additional configuration is required for basic usage

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

vercel Bot commented Apr 11, 2026

Copy link
Copy Markdown
Author

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

Project Deployment Actions Updated (UTC)
advisory-engine Ready Ready Preview, Comment Apr 11, 2026 1:54am

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