@speedcurve/lux
v4.0.28
Published
![](https://img.shields.io/bundlephobia/minzip/%40speedcurve%2Flux) ![](https://img.shields.io/bundlephobia/min/%40speedcurve%2Flux)
Downloads
113
Readme
lux.js - real user monitoring
This repository contains the source code for lux.js, SpeedCurve's real user monitoring (RUM) script.
How to use lux.js
- Sign up for a SpeedCurve account
- Go to the Settings page and scroll to the bottom of the page
- Click on Edit RUM
- Click on the JS Snippet tab
- Copy the RUM JS snippet into the
<head>
of your page
⚠️ Self-hosting lux.js is not recommended. Please read our self-hosting documentation for more information.
Configuring lux.js
See the lux.js API documentation.
Using lux.js in a SPA
Project goals
- Browser compatibility - lux.js runs and gathers basic metrics in every browser that supports ES3, while still gathering modern metrics from evergreen browsers.
- Small size - lux.js aims to be under 10 KB when minified and compressed.
- Low overhead - lux.js creates only a handful of event handlers and observers. Most metrics are calculated on-demand before a beacon is sent.
Local development
- Compile the lux.js script with
npm run build
ornpm run watch
- Run the tests with
npm run test
- Check for linting errors with
npm run lint
and automatically fix them (where possible) withnpm run lint-fix
Release process
- Propose changes in a pull request
- Once approved, merge changes to the
main
branch - Increment the
SCRIPT_VERSION
constant on themain
branch - Add release information into CHANGELOG.md in this repo
- Create a new release in GitHub, following the naming convention and documentation process of previous releases
- Run
npm run build
to generate the lux.js bundles. - Follow the rum-backend release process to deploy the updated lux.js bundles.