Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vaneenige/untrace

🐳 Minimal event tracking on the client in 300 bytes.
https://github.com/vaneenige/untrace

api event npm package request tracking

Last synced: about 2 months ago
JSON representation

🐳 Minimal event tracking on the client in 300 bytes.

Awesome Lists containing this project

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**.


npm


travis

## Install

This library is built with [node](http://nodejs.org) and [npm](https://npmjs.com) and are required for installation.

**1. Install the library with npm.**
```sh
$ npm install --save untrace
```

**2. Import the library in your project.**
```javascript
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.

```js
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.

```js
untrace.send({
type: 'performance',
value: '200ms'
});
```

## License
[MIT License](LICENSE) © [Colin van Eenige](https://use-the-platform.com/)