Skip to content

Helix RUM Event Generator for JavaScript

License

Notifications You must be signed in to change notification settings

langswei/helix-rum-js

 
 

Repository files navigation

Helix RUM JS

Helix RUM Event Generator for JavaScript

Status

codecov CircleCI GitHub license GitHub issues LGTM Code Quality Grade: JavaScript semantic-release

Usage

If you want to collect a RUM event programmatically, use this in your JavaScript code:

import { sampleRUM } from 'https://rum.hlx.page/.rum/@adobe/helix-rum-js@^1/src/index.js';

sampleRUM('top');
window.addEventListener('load', () => sampleRUM('load'));
document.addEventListener('click', () => sampleRUM('click'));

You can pin a version number by using a URL like https://rum.hlx.page/.rum/@adobe/[email protected]/src/index.js instead.

To enable advanced RUM functionality, such as reporting of Core Web Vitals, fire the lazy checkpoint as soon as your render-critical Javascript has executed.

// after all render-critical Javascript has been run
sampleRUM('lazy');

For usage of the sampleRUM function, follow the API documentation.

Development

Build

$ npm install

Test

$ npm test

Lint

$ npm run lint

About

Helix RUM Event Generator for JavaScript

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%