0.3.6 • Published 11 months ago

@mcansh/remix-web-vitals v0.3.6

Weekly downloads
-
License
MIT
Repository
github
Last release
11 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

11 months ago

0.3.5

1 year ago

0.3.4

1 year ago

0.3.3

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago