Skip to content

lib/webVitals/webVital

function getWebVitals(): Promise<GetWebVitalsData>

Defined in: studiocms/packages/studiocms/src/lib/webVitals/webVital.ts:43

Fetches web vitals data from the Astro database.

Promise<GetWebVitalsData>

A promise that resolves to an object containing web vitals data.

The returned object contains the following properties:

  • raw: The raw web vitals data.
  • routeSummary: A summary of web vitals data by route.
  • summary: A general summary of web vitals data.
  • twentyFourHours: An object containing web vitals data for the last 24 hours, with summary and routeSummary properties.
  • sevenDays: An object containing web vitals data for the last 7 days, with summary and routeSummary properties.
  • thirtyDays: An object containing web vitals data for the last 30 days, with summary and routeSummary properties.

If the web vitals metric table is not found in the Astro database, or if an error occurs, an empty return object is returned.

If there is an issue with fetching or processing the web vitals data.

Re-exports GetWebVitalsData

Re-exports IntermediateWebVitalsRouteSummary

Re-exports MetricStats

Re-exports WebVitalsMetricSummary

Re-exports WebVitalsResponseItem

Re-exports WebVitalsRouteSummary

Re-exports WebVitalsSummary