@astrojs/web-vitals
Présentation
Section intitulée « Présentation »Cette intégration Astro permet de suivre les performances réelles de votre site web et de stocker les données dans Astro DB. Ces données seront utilisées dans le tableau de bord StudioCMS pour afficher les indicateurs de performance de votre site web en conditions réelles au fil du temps.
Installation
Section intitulée « Installation »-
Installez le paquet et ajoutez-le à votre configuration Astro à l’aide de la commande suivante :
Fenêtre de terminal npx astro add @astrojs/web-vitalsFenêtre de terminal pnpm astro add @astrojs/web-vitalsFenêtre de terminal yarn astro add @astrojs/web-vitals -
Envoyez la nouvelle configuration vers votre base de données distante :
Fenêtre de terminal npx astro db pushFenêtre de terminal pnpm astro db pushFenêtre de terminal yarn astro db push
-
Installez le paquet à l’aide de la commande suivante :
Fenêtre de terminal npm i @astrojs/web-vitalsFenêtre de terminal pnpm add @astrojs/web-vitalsFenêtre de terminal yarn add @astrojs/web-vitals -
Ajoutez
@astrojs/web-vitals
à votre fichier de configuration Astro :astro.config.mjs importnode from '@astrojs/node';function node(userOptions: UserOptions): AstroIntegrationimportstudioCMS from 'studiocms';const studioCMS: (options?: {sdk?: boolean | {cacheConfig?: boolean | {lifetime?: string | undefined;} | undefined;} | undefined;dbStartPage?: boolean | undefined;imageService?: {cdnPlugin?: "cloudinary-js" | undefined;} | undefined;defaultFrontEndConfig?: boolean | {htmlDefaultLanguage?: string | undefined;htmlDefaultHead?: {tag: "link" | "title" | "base" | "style" | "meta" | "script" | "noscript" | "template";attrs?: Record<string, string | boolean | undefined> | undefined;content?: string | undefined;}[] | undefined;favicon?: string | undefined;injectQuickActionsMenu?: boolean | undefined;} | undefined;dashboardConfig?: {dashboardEnabled?: boolean | undefined;inject404Route?: boolean | undefined;faviconURL?: string | undefined;dashboardRouteOverride?: string | undefined;AuthConfig?: {providers?: {github?: boolean | undefined;discord?: boolean | undefined;google?: boolean | undefined;auth0?: boolean | undefined;usernameAndPassword?: boolean | undefined;usernameAndPasswordConfig?: {allowUserRegistration?: boolean | undefined;} | undefined;} | undefined;enabled?: boolean | undefined;} | undefined;developerConfig?: {demoMode?: false | {password: string;username ...StudioCMS Integration
A CMS built for Astro by the Astro Community for the Astro Community.
importdb from '@astrojs/db';function db(): AstroIntegration[]importwebVitals from '@astrojs/web-vitals';function webVitals({ deprecated }?: {deprecated?: boolean;}): AstroIntegrationimport {defineConfig } from 'astro/config';function defineConfig<const TLocales extends Locales = never, const TDriver extends SessionDriverName = never, const TFontFamilies extends FontFamily[] = never>(config: AstroUserConfig<TLocales, TDriver, TFontFamilies>): AstroUserConfig<TLocales, TDriver, TFontFamilies>See the full Astro Configuration API Documentation https://astro.build/config
export defaultdefineConfig({defineConfig<never, never, never>(config: AstroUserConfig<never, never, never>): AstroUserConfig<never, never, never>See the full Astro Configuration API Documentation https://astro.build/config
site: 'https://demo.studiocms.dev/',AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never, TFontFamilies extends FontFamily[] = never>.site?: stringoutput: 'server',AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never, TFontFamilies extends FontFamily[] = never>.output?: "server" | "static"adapter:AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never, TFontFamilies extends FontFamily[] = never>.adapter?: AstroIntegrationnode({function node(userOptions: UserOptions): AstroIntegrationmode: "standalone" }),UserOptions.mode: "standalone" | "middleware"Specifies the mode that the adapter builds to.
- 'middleware' - Build to middleware, to be used within another Node.js server, such as Express.
- 'standalone' - Build to a standalone server. The server starts up just by running the built script.
integrations: [AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never, TFontFamilies extends FontFamily[] = never>.integrations?: (false | AstroIntegration | (false | AstroIntegration | null | undefined)[] | null | undefined)[]db(), // REQUISfunction db(): AstroIntegration[]webVitals(),function webVitals({ deprecated }?: {deprecated?: boolean;}): AstroIntegrationstudioCMS(),function studioCMS(options?: {sdk?: boolean | {cacheConfig?: boolean | {lifetime?: string | undefined;} | undefined;} | undefined;dbStartPage?: boolean | undefined;imageService?: {cdnPlugin?: "cloudinary-js" | undefined;} | undefined;defaultFrontEndConfig?: boolean | {htmlDefaultLanguage?: string | undefined;htmlDefaultHead?: {tag: "link" | "title" | "base" | "style" | "meta" | "script" | "noscript" | "template";attrs?: Record<string, string | boolean | undefined> | undefined;content?: string | undefined;}[] | undefined;favicon?: string | undefined;injectQuickActionsMenu?: boolean | undefined;} | undefined;dashboardConfig?: {dashboardEnabled?: boolean | undefined;inject404Route?: boolean | undefined;faviconURL?: string | undefined;dashboardRouteOverride?: string | undefined;AuthConfig?: {providers?: {github?: boolean | undefined;discord?: boolean | undefined;google?: boolean | undefined;auth0?: boolean | undefined;usernameAndPassword?: boolean | undefined;usernameAndPasswordConfig?: {allowUserRegistration?: boolean | undefined;} | undefined;} | undefined;enabled?: boolean | undefined;} | undefined;developerConfig?: {demoMode?: false | {password: string;username ...StudioCMS Integration
A CMS built for Astro by the Astro Community for the Astro Community.
],});Fenêtre de terminal npm i @astrojs/web-vitalsFenêtre de terminal pnpm add @astrojs/web-vitalsFenêtre de terminal yarn add @astrojs/web-vitals -
Envoyez la nouvelle configuration vers votre base de données distante :
Fenêtre de terminal npx astro db pushFenêtre de terminal pnpm astro db pushFenêtre de terminal yarn astro db push