npm.io
1.1.44 • Published 1 week ago

@amplitude/plugin-web-vitals-browser

Licence
MIT
Version
1.1.44
Deps
3
Size
104 kB
Vulns
0
Weekly
0
Stars
179


@amplitude/plugin-web-vitals-browser (beta)

This plugin is in beta at the moment, naming and interface might change in the future.

Autocaptures web-vitals metrics (INP, LCP, FCP, CLS)

Installation

This package is published on NPM registry and is available to be installed using npm and yarn.

# npm
npm install @amplitude/plugin-web-vitals-browser@beta

# yarn
yarn add @amplitude/plugin-web-vitals-browser@beta

Usage

import * as amplitude from '@amplitude/analytics-browser';
import { webVitalsPlugin } from '@amplitude/plugin-web-vitals-browser';
2. Instantiate the plugin
const plugin = webVitalsPlugin();
3. Install plugin to Amplitude SDK
amplitude.add(plugin);
4. Initialize Amplitude SDK
amplitude.init('API_KEY');