Vite plugin for integrating Microsoft Clarity analytics. Current stable version is 1.0.0. This plugin simplifies adding Clarity tracking to any Vite project (compatible with Vite ^4 || ^5). It ships TypeScript types and is lightweight with no additional runtime dependencies. Unlike manual injection, this plugin handles environment variables, script loading, and type-safe options.
npm install vite-plugin-ms-clarityNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to integrate the plugin with Vite using environment variable for the Clarity ID.
Ensure the environment variable VITE_CLARITY_ID is set and valid before building.
Upgrade Vite to version 4 or 5.
Review the Options interface after each update and fix any type errors.
Run npm install vite-plugin-ms-clarity --save-dev and ensure tsconfig.json has compilerOptions.types or includes node_modules.
Upgrade Vite to ^4 || ^5 and clear node_modules/.vite cache (rm -rf node_modules/.vite).
Set the environment variable VITE_CLARITY_ID to a valid Clarity project ID.
No dependency data recorded yet.