vercel-analytics
Set up Vercel Analytics and Speed Insights for React/Vite projects
Imported description, not reviewed yet
This item came from its original repository and was only scanned automatically; no editor has written an Arabic description for it yet. Read its content yourself before you rely on it. This page is not indexed by search engines until it is reviewed.
Download
Install
After downloading, run the command in a terminal. unzip asks before it replaces any file that is there.
For this project
It goes in: .claude/commands/
mkdir -p .claude/commands && unzip ~/Downloads/vercel-analytics.zip -d .claude/commandsFor your account on the whole machine
It goes in: ~/.claude/commands/
mkdir -p ~/.claude/commands && unzip ~/Downloads/vercel-analytics.zip -d ~/.claude/commands
Instructions
Vercel Analytics Setup
Automatically configure Vercel Analytics and Speed Insights for your React/Vite project.
Usage: /vercel-analytics (no arguments needed)
What it does:
- Installs @vercel/analytics and @vercel/speed-insights packages
- Adds components to your React app
- Configures SPA routing for Vercel deployment
- Fixes 404 errors for direct route access
Process:
-
Install Vercel Packages
npm install @vercel/analytics @vercel/speed-insights -
Detect Main App File
- Search for main React entry point:
src/App.tsxorsrc/App.jsxsrc/main.tsxorsrc/main.jsx
- Read file to determine current structure
- Search for main React entry point:
-
Add Analytics Components
- Import Analytics from '@vercel/analytics/react'
- Import SpeedInsights from '@vercel/speed-insights/react'
- Add both components to the main App component
- Use
/reactimports (not/next)
-
Create vercel.json Configuration
- Create
vercel.jsonin project root - Add SPA rewrite rules:
{ "rewrites": [ { "source": "/(.*)", "destination": "/index.html" } ] }- This ensures all routes serve index.html (fixes 404s)
- Create
-
Verify Setup
- Confirm components are properly imported
- Check vercel.json exists and is valid
- Display success message with next steps
Expected Outcome:
- ✅ Analytics tracking active
- ✅ Speed Insights monitoring configured
- ✅ SPA routing works correctly on Vercel
- ✅ No 404 errors on direct route access
Next Steps:
- Deploy to Vercel:
vercel deploy - View analytics at: https://vercel.com/dashboard/analytics
- Check Speed Insights: https://vercel.com/dashboard/speed-insights
Note: Works with React, Vite, Create React App, and other SPA frameworks.
Files
- LICENSE1 KB
- vercel-analytics.md1.9 KB
What the automatic scan found
We scanned the files automatically when they were imported. This is what the scan pointed at. It does not mean the item is harmful, and it does not mean it is safe: read it yourself.
- Needs a lookAllowed tools with no limits
In file cli-tool/components/commands/setup/vercel-analytics.md
Comments (0)
No comments yet. Be the first.
Sign in to comment. Commenting comes at level 1 (Member).