Slide 74
Slide 74 text
CrUX Dashboard & CrUX API
LCP
const KEY = apiKey;
async function (requestBody) {
const endpointUrl = 'https://chromeuxreport.googleapis.com/v1/
records:queryRecord';
const resp = await fetch(`${endpointUrl}?key=${KEY}`, {
method: 'POST',
body: JSON.stringify(requestBody),
});
const json = await resp.json();
if (!resp.ok) {
throw new Error(json.error.message);
}
return json;