Skip to content

Commit e019d1e

Browse files
docs: Add log provider to README.md (#36)
* Add `log` provider to README.md Getting to know that this module can only be used to preview those metrics in development environment can involve people to use this great module. I also added a small note about what this module does (related to #34) * chore: add warning about using log provider
1 parent 4c31d7d commit e019d1e

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

README.md

+23-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
> Web Vitals: Essential module for a healthy [Nuxt.js](https://github.com/nuxt/nuxt.js)
44
5-
[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.
5+
[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.
6+
This 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)
67

78
## Installation
89

@@ -42,9 +43,9 @@ export default {
4243

4344
### Google Analytics
4445

45-
Create a GA property and get `trackingID`
46-
46+
_Report WebVitals to GA_
4747

48+
Create a GA property and get `trackingID`
4849

4950
Either provide `GOOGLE_ANALYTICS_ID` environement variable or set inside `nuxt.config`:
5051

@@ -63,8 +64,27 @@ Behavior > Events > Overview > Event Category > Event Action
6364

6465
### Vercel Analytics
6566

67+
_Report WebVitals to Vercel_
68+
6669
Works without configuration
6770

71+
### Basic logger
72+
73+
_Report WebVitals to Console_
74+
75+
Output metrics to the console insead of sending them to a remote provider
76+
77+
```js
78+
{
79+
webVitals: {
80+
provider: 'log',
81+
debug: true, // debug enable metrics reporting on dev environments
82+
disabled: false
83+
}
84+
}
85+
```
86+
87+
:warning: this provider does not send WebVitals trough network, issues with navigator extensions can not be deteced with this method.
6888

6989
### License
7090

0 commit comments

Comments
 (0)