Browser & Web Performance · Middle · Question 68 of 75
How do you collect LCP, INP and CLS from real users with little code?
- ✓Correct answer: Use the
web-vitalslibrary and send its values to your analytics endpoint - 2Read them from
document.performance.vitals - 3Run Lighthouse in each user's browser
Explanation
The library wraps PerformanceObserver and handles edge cases like bfcache restores and background tabs.