A tiny, modular JavaScript library for measuring Core Web Vitals and other essential performance metrics on real users.
Web Vitals is a JavaScript library developed by the Google Chrome team for measuring essential web performance metrics on real users. It provides functions to accurately track Core Web Vitals (CLS, INP, LCP) and other metrics like FCP and TTFB, matching how Chrome measures them. It solves the problem of understanding actual user experience and diagnosing performance issues in production.
Frontend developers, performance engineers, and web analytics teams who need to measure and optimize real-user performance for their websites or web applications.
Developers choose Web Vitals because it's the official, lightweight library that guarantees measurement accuracy aligned with Google's tools (Chrome UX Report, PageSpeed Insights). Its modular design, attribution features for debugging, and flexible reporting options make it the most reliable way to collect performance data.
Essential metrics for a healthy site.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Measures Web Vitals exactly as Chrome and Google tools like PageSpeed Insights do, ensuring data consistency with industry standards for real-user experience.
The standard build is tiny at ~2K brotli'd, minimizing performance overhead and making it easy to add without significant load impact.
The optional attribution build adds detailed diagnostic data, such as element targets and timing breakdowns, to help identify root causes of poor performance in production.
Supports loading via npm, CDN, or classic scripts, with no need for early loading due to the buffered PerformanceObserver flag, allowing deferred integration.
CLS measurement is only available in Chromium-based browsers, leaving gaps for users on Firefox or Safari, as noted in the browser support section.
Cannot capture metrics within iframes, even same-origin ones, which means data may not match comprehensive tools like Chrome User Experience Report, as admitted in the limitations.
While useful for debugging, the attribution build is about 1.5K larger and adds complexity, requiring careful setup for custom analytics pipelines.