Skip to content
CommandImported

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

Files: 1 · Size: 3 KB

Download the ZIP

The file carries the license of the original source.

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/commands

  • For 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:

  1. Install Vercel Packages

    npm install @vercel/analytics @vercel/speed-insights
    
  2. Detect Main App File

    • Search for main React entry point:
      • src/App.tsx or src/App.jsx
      • src/main.tsx or src/main.jsx
    • Read file to determine current structure
  3. 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 /react imports (not /next)
  4. Create vercel.json Configuration

    • Create vercel.json in project root
    • Add SPA rewrite rules:
    {
      "rewrites": [
        { "source": "/(.*)", "destination": "/index.html" }
      ]
    }
    
    • This ensures all routes serve index.html (fixes 404s)
  5. 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:

  1. Deploy to Vercel: vercel deploy
  2. View analytics at: https://vercel.com/dashboard/analytics
  3. 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).

Report

Similar items

  • CommandImported

    act

    Execute GitHub Actions locally using act

    MITFiles: 1

  • CommandImported

    add-performance-monitoring

    Setup comprehensive application performance monitoring with metrics, alerting, and observability

    MITFiles: 1

  • CommandImported

    azure-role-selector

    When user is asking for guidance for which role to assign to an identity given desired permissions, this agent helps them understand the role that will meet the requirements with least privilege access and how to apply that role.

    MITFiles: 1

  • CommandImported

    blue-green-deployment

    Implement blue-green deployment strategy with zero-downtime switching, health validation, and automatic rollback

    MITFiles: 1

  • CommandImported

    ci-pipeline

    Manage and automate CI/CD pipeline configuration with GitHub Actions, multi-environment support, and deployment strategies

    MITFiles: 1