1.0.2 • Published 4 years ago
perfanalytics.js v1.0.2
Perfanalytics Js
This is a client-side library, which collects some performance related key metrics from browser and sends to the PerfAnalytics.API.
Usage
<!-- Import client side script -->
<script src="path/to/perfanalytics.min.js"></script>
<!-- Initialize -->
<script>
Perfanalytics({token : 'XXXXXX'});
</script>
About
It operates token-based to provide validation in the production environment in the future and to facilitate the addition of library configuration features.
- Bundle size of library is 2,7 kB (2.671 bytes)
- This library measure timing of TTFB, FCP, Dom Load, Window Load events and Network resources
- Written using ES6
- Used webpack and babel
- Sends performance metrics to API with related
token
andurl
Development
Check the .env.dev
file before development and make sure that the API_BASE_URL
variable is set correctly. If it's ok, you can run the following commands.
npm install
npm run dev
Deployment
We use CircleCI for the CI/CD pipeline. The bundle created by running the following command is pushed to the NPM repository. Necessary configurations were made in .circleci/config.yml
file.
Build
npm run build