chore(docs,deps): update deps (#1598)
* chore(docs,deps): update deps Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> * chore(docs,plugins): update web vitals plugin Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> * chore(docs): update links Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --------- Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { getCLS, getFCP, getFID, getLCP, getTTFB } from 'web-vitals'
|
||||
import { onCLS, onFCP, onFID, onINP, onLCP, onTTFB } from 'web-vitals'
|
||||
|
||||
const vitalsUrl = 'https://vitals.vercel-analytics.com/v1/vitals'
|
||||
|
||||
@@ -43,11 +43,12 @@ function sendToAnalytics(metric, options) {
|
||||
|
||||
export function webVitals(options) {
|
||||
try {
|
||||
getFID((metric) => sendToAnalytics(metric, options))
|
||||
getTTFB((metric) => sendToAnalytics(metric, options))
|
||||
getLCP((metric) => sendToAnalytics(metric, options))
|
||||
getCLS((metric) => sendToAnalytics(metric, options))
|
||||
getFCP((metric) => sendToAnalytics(metric, options))
|
||||
onFID((metric) => sendToAnalytics(metric, options))
|
||||
onTTFB((metric) => sendToAnalytics(metric, options))
|
||||
onLCP((metric) => sendToAnalytics(metric, options))
|
||||
onCLS((metric) => sendToAnalytics(metric, options))
|
||||
onFCP((metric) => sendToAnalytics(metric, options))
|
||||
onINP((metric) => sendToAnalytics(metric, options))
|
||||
} catch (err) {
|
||||
console.error('[Analytics]', err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user