Install Vercel Speed Insights - #2
Draft
vercel[bot] wants to merge 1 commit into
Draft
Conversation
Implemented Vercel Speed Insights for this project I successfully installed and configured Vercel Speed Insights following the latest official documentation from https://vercel.com/docs/speed-insights/quickstart ## Changes Made: ### 1. Package Installation - Added `@vercel/speed-insights` v2.0.0 to dependencies in package.json - Updated package-lock.json with the new dependency and its subdependencies ### 2. Speed Insights Integration (public/index.html) - Added the Speed Insights script tag: `<script defer src="/_vercel/speed-insights/script.js"></script>` - Placed it alongside the existing Vercel Analytics script for consistency - Used `defer` attribute to ensure non-blocking loading ### 3. Content Security Policy Update (vercel.json) - Updated the CSP `connect-src` directive to allow connections to: - `https://vercel-insights.com` - `https://vitals.vercel-insights.com` - This allows Speed Insights to send performance data to Vercel's servers - Maintained all existing security policies ## Implementation Notes: This project uses vanilla HTML/JavaScript (not a framework like Next.js or React), so I followed the "Vanilla/Other Frameworks" approach from the official documentation, which requires adding the script tag directly to the HTML. The Speed Insights script will be automatically served by Vercel at `/_vercel/speed-insights/script.js` once Speed Insights is enabled in the Vercel dashboard for this project. ## Verification: - Build script completed successfully - All JavaScript syntax checks passed (npm run check) - No linting errors introduced - Package lock file properly updated ## Next Steps: To complete the setup, the project maintainer should: 1. Enable Speed Insights in the Vercel dashboard (Project Settings → Speed Insights → Enable) 2. Deploy the changes to Vercel 3. Monitor performance metrics in the Speed Insights dashboard after user visits Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Author
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Implemented Vercel Speed Insights for this project
I successfully installed and configured Vercel Speed Insights following the latest official documentation from https://vercel.com/docs/speed-insights/quickstart
Changes Made:
1. Package Installation
@vercel/speed-insightsv2.0.0 to dependencies in package.json2. Speed Insights Integration (public/index.html)
<script defer src="/_vercel/speed-insights/script.js"></script>deferattribute to ensure non-blocking loading3. Content Security Policy Update (vercel.json)
connect-srcdirective to allow connections to:https://vercel-insights.comhttps://vitals.vercel-insights.comImplementation Notes:
This project uses vanilla HTML/JavaScript (not a framework like Next.js or React), so I followed the "Vanilla/Other Frameworks" approach from the official documentation, which requires adding the script tag directly to the HTML.
The Speed Insights script will be automatically served by Vercel at
/_vercel/speed-insights/script.jsonce Speed Insights is enabled in the Vercel dashboard for this project.Verification:
Next Steps:
To complete the setup, the project maintainer should:
View Project · Speed Insights
Created by davidsutrin (davidsutrin) with Vercel Agent