Skip to content

Instantly share code, notes, and snippets.

@thangman22
Created April 14, 2023 04:52
Show Gist options
  • Save thangman22/592f57fefa045c205f6c0b62b7b35667 to your computer and use it in GitHub Desktop.
Save thangman22/592f57fefa045c205f6c0b62b7b35667 to your computer and use it in GitHub Desktop.
inp.js
// Use the attribution build:
import { onINP } from "web-vitals/attribution";
// Example reporting function that's passed to web-vitals:
const report = ({ name, value, attribution }) => {
 console.log(name);
 console.log(value);
 console.log(attribution.eventType);
 console.log(attribution.eventTarget);
};
// Pass the reporting function to the INP reporter:
onINP(report);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment