untrace
v1.0.2
Published
Minimal event tracking on the client in 300 bytes.
Downloads
2
Readme
untrace
Minimal event tracking on the client in 300 bytes.
- Only 300 bytes gzipped.
- Easy to use with only two functions.
- Modern browser support.
Install
This library is built with node and npm and are required for installation.
1. Install the library with npm.
$ npm install --save untrace
2. Import the library in your project.
import untrace from 'untrace';
Usage
This library provides two functions:
start()
- Creates an unique hash for the browser (once).
- Creates an unique hash for the session (repeat).
- Should be configured with endpoint for all requests.
const endpoint = './api';
untrace.start(endpoint);
send()
- Combines parameters with browser and session hashes.
- Custom parameters are not limited in amount.
- Posts the combined parameters to the endpoint.
untrace.send({
type: 'performance',
value: '200ms'
});