A tiny library that measures LCP, INP, CLS, FCP and TTFB from real users the same way Chrome does.
When to use it
You want field performance data, ideally split by display mode.
Get started
npm i web-vitals
import { onLCP, onINP, onCLS } from 'web-vitals';
[onLCP, onINP, onCLS].forEach((fn) => fn((m) => sendToAnalytics(m.name, m.value)));
Source code, issues and documentation: github.com/GoogleChrome/web-vitals.