Skip to content

Install and configure Vercel Speed Insights - #2

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

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

Conversation

@vercel

@vercel vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

Vercel Speed Insights Installation

Successfully installed and configured Vercel Speed Insights for this Astro project.

Changes Made

Created:

  • None (all changes were modifications to existing files)

Modified:

  1. package.json - Added @vercel/speed-insights version ^1.1.0 to dependencies
  2. package-lock.json - Updated with the new package and its dependencies
  3. src/layouts/BaseLayout.astro - Added Speed Insights script tag in the head section

Implementation Details

Following the official Vercel Speed Insights quickstart documentation (https://vercel.com/docs/speed-insights/quickstart), I implemented the Astro-specific integration:

  1. Installed the package: Added @vercel/speed-insights using npm
  2. Added the tracking script: Inserted the Speed Insights script tag (<script is:inline defer src="/_vercel/speed-insights/script.js"></script>) in the BaseLayout.astro file, right after the existing Analytics script tag
  3. Preserved existing structure: The implementation follows the same pattern as the existing Vercel Analytics integration already present in the project

Testing

  • ✅ Build completed successfully (npm run build)
  • ✅ Linter ran without errors (npm run lint)
  • ✅ All dependencies installed correctly

Notes

  • The Speed Insights script uses the standard Vercel path /_vercel/speed-insights/script.js which will automatically be available when deployed to Vercel
  • Speed Insights must be enabled in the Vercel dashboard for the project to start collecting data
  • The script is loaded with the defer attribute to ensure it doesn't block page rendering
  • The implementation is consistent with the existing Vercel Analytics integration pattern in the project

View Project · Speed Insights

Created by cristobalgize (luiscristobalprz-7878) with Vercel Agent

## Vercel Speed Insights Installation

Successfully installed and configured Vercel Speed Insights for this Astro project.

### Changes Made

**Created:**
- None (all changes were modifications to existing files)

**Modified:**
1. `package.json` - Added `@vercel/speed-insights` version ^1.1.0 to dependencies
2. `package-lock.json` - Updated with the new package and its dependencies
3. `src/layouts/BaseLayout.astro` - Added Speed Insights script tag in the head section

### Implementation Details

Following the official Vercel Speed Insights quickstart documentation (https://vercel.com/docs/speed-insights/quickstart), I implemented the Astro-specific integration:

1. **Installed the package**: Added `@vercel/speed-insights` using npm
2. **Added the tracking script**: Inserted the Speed Insights script tag (`<script is:inline defer src="/_vercel/speed-insights/script.js"></script>`) in the BaseLayout.astro file, right after the existing Analytics script tag
3. **Preserved existing structure**: The implementation follows the same pattern as the existing Vercel Analytics integration already present in the project

### Testing

- ✅ Build completed successfully (`npm run build`)
- ✅ Linter ran without errors (`npm run lint`)
- ✅ All dependencies installed correctly

### Notes

- The Speed Insights script uses the standard Vercel path `/_vercel/speed-insights/script.js` which will automatically be available when deployed to Vercel
- Speed Insights must be enabled in the Vercel dashboard for the project to start collecting data
- The script is loaded with the `defer` attribute to ensure it doesn't block page rendering
- The implementation is consistent with the existing Vercel Analytics integration pattern in the project

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

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown
Author

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

Project Deployment Actions Updated (UTC)
corrupcion-db Ready Ready Preview Aug 10, 2026 5:57am

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