Skip to content

Install Vercel Speed Insights#2

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

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

Conversation

@vercel

@vercel vercel Bot commented May 19, 2026

Copy link
Copy Markdown

Vercel Speed Insights Integration

Successfully installed and configured Vercel Speed Insights for this static HTML project.

Changes Made

1. Package Installation

  • Modified: package.json

    • Added @vercel/speed-insights version ^2.0.0 as a dependency
  • Modified: package-lock.json

    • Updated with @vercel/speed-insights package and its dependencies

2. Speed Insights Integration

  • Modified: index.html
    • Added Speed Insights initialization script before the closing </body> tag
    • Implemented the queue-based approach recommended for static sites
    • Added two script tags:
      1. Initialization script that sets up the window.si function and queue
      2. Deferred loading of the Speed Insights script from /_vercel/speed-insights/script.js

Implementation Details

This project is a vanilla HTML/CSS/JavaScript static site without a build process. Following the official Vercel documentation for static sites, I implemented the queue-based initialization pattern:

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

This approach:

  • Works seamlessly when deployed to Vercel
  • Uses the defer attribute for optimal performance
  • Queues events before the script loads to prevent data loss
  • Automatically starts tracking web vitals and performance metrics

Next Steps

To complete the setup:

  1. Deploy the project to Vercel (the Speed Insights script will be automatically served)
  2. Enable Speed Insights in the Vercel dashboard for this project
  3. After deployment and user visits, view performance data in the Speed Insights dashboard

Notes

  • The Speed Insights integration follows Vercel's official quickstart documentation
  • The /_vercel/speed-insights/script.js path is automatically handled by Vercel's platform
  • No additional configuration is required for basic functionality
  • The integration preserves all existing code structure and functionality

View Project · Speed Insights

Created by zeke-codes with Vercel Agent

# Vercel Speed Insights Integration

Successfully installed and configured Vercel Speed Insights for this static HTML project.

## Changes Made

### 1. Package Installation
- **Modified**: `package.json`
  - Added `@vercel/speed-insights` version `^2.0.0` as a dependency
  
- **Modified**: `package-lock.json`
  - Updated with `@vercel/speed-insights` package and its dependencies

### 2. Speed Insights Integration
- **Modified**: `index.html`
  - Added Speed Insights initialization script before the closing `</body>` tag
  - Implemented the queue-based approach recommended for static sites
  - Added two script tags:
    1. Initialization script that sets up the `window.si` function and queue
    2. Deferred loading of the Speed Insights script from `/_vercel/speed-insights/script.js`

## Implementation Details

This project is a vanilla HTML/CSS/JavaScript static site without a build process. Following the official Vercel documentation for static sites, I implemented the queue-based initialization pattern:

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

This approach:
- Works seamlessly when deployed to Vercel
- Uses the `defer` attribute for optimal performance
- Queues events before the script loads to prevent data loss
- Automatically starts tracking web vitals and performance metrics

## Next Steps

To complete the setup:
1. Deploy the project to Vercel (the Speed Insights script will be automatically served)
2. Enable Speed Insights in the Vercel dashboard for this project
3. After deployment and user visits, view performance data in the Speed Insights dashboard

## Notes

- The Speed Insights integration follows Vercel's official quickstart documentation
- The `/_vercel/speed-insights/script.js` path is automatically handled by Vercel's platform
- No additional configuration is required for basic functionality
- The integration preserves all existing code structure and functionality

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

vercel Bot commented May 19, 2026

Copy link
Copy Markdown
Author

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

Project Deployment Actions Updated (UTC)
deeportraiture Building Building Preview May 19, 2026 4:32pm

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