2.0.1 • Published 21 days ago

@adobe/helix-rum-js v2.0.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
21 days ago

Helix RUM JS

Helix RUM Event Generator for JavaScript

Status

codecov GitHub Actions GitHub license GitHub issues semantic-release

Usage

If you want to use sampleRUM in project based on the boilerplate, and you are using a compatible aem-lib version there is no need for you to do any specific action. sampleRUM will be initialized in aem-lib and the main checkpoints will be tracked automatically for you.

If you are not sure if your aem-lib version is compatible, open aem.js find the init() function and replace any existing sampleRUM call by simply:

sampleRUM()

load checkpoint is automatically tracked by the rum code. There's no need to add a listener to track it in the init() of aem.js.

If you want to use sampleRUM in a project not based on boilerplate, simply add the following code, at the very beginning of the page load:

import('https://rum.hlx.page/.rum/@adobe/helix-rum-js@^2/src/index.js').then((f)=> f.sampleRUM());

You can pin a version number by using a URL like https://rum.hlx.page/.rum/@adobe/helix-rum-js@1.0.0/src/index.js instead. For usage of the sampleRUM function, follow the API documentation.

BREAKING CHANGES

sampleRUM.on and sampleRUM.always.on hooks are no longer available.

They are replaced by a CustomEvent called rum. The detail of the custom event is an object containing the keys:

{
  checkpoint: checkpoint-name,
  data: { checkpoint-data},
}

Simplified sample code to listen to this event:

  document.addEventListener('rum', (event) => {
    if(event.detail) {
      const checkpoint = event.detail.checkpoint;
      const data = event.detail.data;
      console.log(`RUM Event: checkpoint ${checkpoint} source: ${data.source}`};
    }
  });

Development

Build

$ npm install

Test

$ npm test

Lint

$ npm run lint
2.0.1

21 days ago

2.0.0

4 months ago

1.8.0

5 months ago

1.7.0

7 months ago

1.2.0

9 months ago

1.1.0

10 months ago

1.6.0

7 months ago

1.5.0

8 months ago

1.4.1

8 months ago

1.4.0

8 months ago

1.3.0

8 months ago

1.0.1

1 year ago

1.0.0

2 years ago