Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. PageSpeed Metrics
  3. Web Vitals

Web Vitals

Apache-2.0JavaScript

A tiny, modular JavaScript library for measuring Core Web Vitals and other essential performance metrics on real users.

Visit WebsiteGitHubGitHub
8.7k stars537 forks0 contributors

What is Web Vitals?

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.

Target Audience

Frontend developers, performance engineers, and web analytics teams who need to measure and optimize real-user performance for their websites or web applications.

Value Proposition

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.

Overview

Essential metrics for a healthy site.

Use Cases

Best For

  • Measuring Core Web Vitals (CLS, INP, LCP) in production environments
  • Sending real-user performance data to analytics platforms like Google Analytics
  • Debugging performance issues with detailed attribution data
  • Integrating performance monitoring into custom analytics pipelines
  • Tracking performance metrics for SEO and user experience optimization
  • Creating performance dashboards with data from real users

Not Ideal For

  • Synthetic performance testing in lab environments (e.g., using Lighthouse or WebPageTest for pre-deployment checks)
  • Projects requiring performance metrics from within iframes, as the library has no visibility into iframe content
  • Websites targeting legacy browsers without support for modern Performance APIs, particularly for CLS measurement
  • Server-side performance monitoring, since the library only runs in the browser and cannot measure backend latency or server processing times

Pros & Cons

Pros

Official Google Accuracy

Measures Web Vitals exactly as Chrome and Google tools like PageSpeed Insights do, ensuring data consistency with industry standards for real-user experience.

Minimal Bundle Size

The standard build is tiny at ~2K brotli'd, minimizing performance overhead and making it easy to add without significant load impact.

Powerful Debugging Attribution

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.

Flexible Integration Options

Supports loading via npm, CDN, or classic scripts, with no need for early loading due to the buffered PerformanceObserver flag, allowing deferred integration.

Cons

Limited Cross-Browser Support

CLS measurement is only available in Chromium-based browsers, leaving gaps for users on Firefox or Safari, as noted in the browser support section.

No Iframe Measurement

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.

Attribution Build Overhead

While useful for debugging, the attribution build is about 1.5K larger and adds complexity, requiring careful setup for custom analytics pipelines.

Frequently Asked Questions

Quick Stats

Stars8,653
Forks537
Contributors0
Open Issues11
Last commit7 days ago
CreatedSince 2020

Tags

#analytics-integration#web-performance#javascript-library#frontend-optimization#real-user-monitoring#performance-metrics#user-experience#core-web-vitals

Built With

T
TypeScript

Links & Resources

Website

Included in

Web Performance Optimization8.9kPageSpeed Metrics689
Auto-fetched 1 day ago

Related Projects

LighthouseLighthouse

Automated auditing, performance metrics, and best practices for the web.

Stars30,924
Forks9,772
Last commit1 day ago
LighthouseLighthouse

Automate running Lighthouse for every commit, viewing the changes, and preventing regressions

Stars7,116
Forks726
Last commit3 days ago
Chrome User Experience Report (CrUX)Chrome User Experience Report (CrUX)

Stars0
Forks0
Last commit
Load abandonmentLoad abandonment

Track visibilitychange to account for survivorship bias

Stars0
Forks0
Last commit
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub