0.3.6 • Published 4 months ago

@mcansh/remix-web-vitals v0.3.6

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Vercel Remix Web Vitals

Save Web Vitals to Vercel

Installation

# npm
npm i @mcansh/remix-web-vitals

# pnpm
pnpm i @mcansh/remix-web-vitals

# yarn
yarn add @mcansh/remix-web-vitals

# bun
bun add @mcansh/remix-web-vitals

Usage

import { WebVitals } from "@mcansh/remix-web-vitals";

export async function loader() {
  return json({ analyticsId: process.env.VERCEL_WEB_ANALYTICS_ID });
}

export default function App() {
  let { analyticsId } = useLoaderData<typeof loader>();

  return (
    <html lang="en">
      <head>
        <meta charSet="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <Meta />
        <Links />
      </head>
      <body>
        <Outlet />
        <ScrollRestoration />
        <Scripts />
        <LiveReload />
        {analyticsId ? <WebVitals analyticsId={analyticsId} /> : null}
      </body>
    </html>
  );
}
0.3.6

4 months ago

0.3.5

7 months ago

0.3.4

7 months ago

0.3.3

9 months ago

0.3.2

10 months ago

0.3.1

10 months ago

0.3.0

10 months ago

0.2.0

10 months ago

0.1.0

11 months ago