{"id":14964249,"url":"https://github.com/nuxt-modules/web-vitals","last_synced_at":"2025-05-14T22:07:50.831Z","repository":{"id":37141240,"uuid":"261995352","full_name":"nuxt-modules/web-vitals","owner":"nuxt-modules","description":"Web Vitals: Essential module for a healthy project","archived":false,"fork":false,"pushed_at":"2025-05-12T05:07:20.000Z","size":1402,"stargazers_count":382,"open_issues_count":17,"forks_count":23,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-12T06:23:15.284Z","etag":null,"topics":["cls","fcp","fid","lcp","metrics","module","nuxt-module","nuxtjs","performance","ttfb"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nuxt-modules.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-05-07T08:36:46.000Z","updated_at":"2025-04-11T01:36:38.000Z","dependencies_parsed_at":"2024-02-05T20:35:37.794Z","dependency_job_id":"911d0010-34e8-44b2-bc7d-1191e96eb684","html_url":"https://github.com/nuxt-modules/web-vitals","commit_stats":{"total_commits":114,"total_committers":16,"mean_commits":7.125,"dds":0.7017543859649122,"last_synced_commit":"b3fad522d9c379c75dc4b7b5e52f29eed1beb8f7"},"previous_names":["daliborgogic/nuxt-vitals"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxt-modules%2Fweb-vitals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxt-modules%2Fweb-vitals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxt-modules%2Fweb-vitals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxt-modules%2Fweb-vitals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuxt-modules","download_url":"https://codeload.github.com/nuxt-modules/web-vitals/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235696,"owners_count":22036963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cls","fcp","fid","lcp","metrics","module","nuxt-module","nuxtjs","performance","ttfb"],"created_at":"2024-09-24T13:32:52.188Z","updated_at":"2025-05-14T22:07:45.812Z","avatar_url":"https://github.com/nuxt-modules.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Nuxt Web Vitals\n\n\u003e Web Vitals: Essential module for a healthy [Nuxt](https://github.com/nuxt/nuxt)\n\n[Web Vitals](https://web.dev/vitals) is an initiative by Google to provide unified guidance for quality signals that are essential to delivering a great user experience on the web.\n\nThis module will gather those metrics on each page view, and send them to a provider using either [`Navigator.sendBeacon()`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon) or [`fetch()`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch)\n\n## Installation\n\n```bash\nnpx nuxi@latest module add web-vitals\n```\n\nAdd `@nuxtjs/web-vitals` to the `modules` section of your `nuxt.config.js`\n\n```javascript\nexport default defineNuxtConfig({\n  modules: [\n    '@nuxtjs/web-vitals'\n  ]\n})\n```\n\n:warning: If you are using Nuxt **\u003c v2.9** you have to install the module as a `dependency` (no `--save-dev` or `--dev` flags). If you are Nuxt 2.9+ (but not Nuxt 3) you should add the module to `buildModules` instead of `modules`.\n\n## Options\n\n```js\nexport default defineNuxtConfig({\n  webVitals: {\n    // provider: '', // auto detectd\n    debug: false,\n    disabled: false\n  }\n})\n```\n\n## Providers\n\n### Google Analytics\n\n_Report WebVitals to GA_\n\nCreate a GA property and get `trackingID`\n\nEither provide `GOOGLE_ANALYTICS_ID` environement variable or set inside `nuxt.config`:\n\n(Top level `googleAnalytics.id` is supported for backward compatibility as fallback)\n\n```js\nexport default defineNuxtConfig({\n  webVitals: {\n    ga: { id: 'UA-XXXXXXXX-X' }\n  }\n})\n```\n\nBehavior \u003e Events \u003e Overview \u003e Event Category \u003e Event Action\n\n![Events Actions](/assets/event-action.png)\n\n\n_Report WebVitals to GTM_\n\nCreate a GTM property and add the tag manager to your site.\n\n```js\nexport default defineNuxtConfig({\n  webVitals: {\n    gtm: {}\n  }\n})\n```\n\n\n### Vercel Analytics\n\n_Report WebVitals to Vercel_\n\nWorks without configuration\n\n### Basic logger\n\n_Report WebVitals to Console_\n\nOutput metrics to the console insead of sending them to a remote provider\n\n```js\nexport default defineNuxtConfig({\n  webVitals: {\n    provider: 'log',\n    debug: true, // debug enable metrics reporting on dev environments\n    disabled: false\n  }\n})\n```\n\n:warning: this provider does not send WebVitals trough network, issues with navigator extensions can not be deteced with this method.\n\n### Logging to custom api\n\n_Report WebVitals to a custom api endpoint_\n\n```js\nexport default defineNuxtConfig({\n  webVitals: {\n    provider: 'api',\n    api: { url: '/api/web-vitals' }\n    debug: true // debug enable metrics reporting on dev environments\n  })\n```\n\nExample body:\n\n```js\nexport default defineNuxtConfig({\n  href: 'http://localhost:3000/',\n  name: 'LCP',\n  value: 303.599,\n  rating: 'good',\n  delta: 303.599,\n  entries: [\n    {\n      name: '',\n      entryType: 'largest-contentful-paint',\n      startTime: 303.599,\n      duration: 0,\n      size: 5698,\n      renderTime: 303.599,\n      loadTime: 0,\n      firstAnimatedFrameTime: 0,\n      id: '',\n      url: ''\n    }\n  ],\n  id: 'v3-1669725914225-9792921995831',\n  navigationType: 'reload'\n})\n```\n\n### License\n\n[MIT](https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuxt-modules%2Fweb-vitals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuxt-modules%2Fweb-vitals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuxt-modules%2Fweb-vitals/lists"}