integration-react-vite

Detect React + Vite projects and initialize the Amplitude Unified SDK.

28|Updated Dec 5, 2025
One-click install
npx skills add https://github.com/amplitude/wizard --skill integration-react-vite-amplitude
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: integration-react-vite
Source: https://github.com/amplitude/wizard/tree/main/skills/integration/integration-react-vite
Command: npx skills add https://github.com/amplitude/wizard --skill integration-react-vite-amplitude

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This integration guide helps developers instrument Amplitude analytics in React applications built with Vite, including setup steps, event planning, and verification workflows.

Core Features & Use Cases

  • Auto-detects React + Vite projects and bootstraps Amplitude's Unified SDK
  • Provides a deterministic, multi-step integration workflow for instrumentation and validation
  • Demonstrates login/user identification and autocapture best practices in a SPA

Quick Start

Run npx @amplitude/wizard to begin integrating Amplitude into your React + Vite project.

Frequently Asked Questions about integration-react-vite

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate Amplitude analytics into a React and Vite app?

To integrate Amplitude analytics into a React and Vite app, run the Amplitude wizard to auto-detect your project and bootstrap the Unified SDK. It provides a deterministic, step-by-step workflow for instrumentation and validation.

What is the best way to set up Amplitude event tracking in a single-page React application?

Setting up Amplitude event tracking in a single-page React application involves initializing the Unified SDK and following a guided plan for event planning, code insertion, and verification. Best practices include environment-based API keys and proper event naming.

Does the Amplitude Unified SDK support autocapture for React Vite projects?

Yes, the Amplitude Unified SDK supports autocapture for React Vite projects. The integration workflow guides you through enabling autocapture via configuration to automatically track user interactions within your single-page app.

How do I track user logins and set user identities in Amplitude for my Vite SPA?

To track user logins and set identities in Amplitude for a Vite SPA, the integration enforces using setUserId and Identify calls upon login. This ensures accurate user identification and event attribution during the instrumentation process.

Can I use environment variables for Amplitude API keys in a Vite React project?

Yes, you can and should use environment variables for Amplitude API keys in a Vite React project. The integration enforces environment-based API key configuration as a best practice to keep your analytics setup secure and maintainable.