# usability-tracker

> automated usability tester. Used to keep track of user actions and their goals when using the program.

Latest version **1.0.3** (published 2022-08-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install usability-tracker
pnpm add usability-tracker
yarn add usability-tracker
bun add usability-tracker
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2022-08-11 |
| First published | 2022-08-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 13.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | lewibs |
| Maintainers | lewibs |
| Keywords | usability, test, testing, user, tracking, logging, search |

## Links

- npm: https://www.npmjs.com/package/usability-tracker
- Repository: https://github.com/lewibs/usability-tracker
- Homepage: https://github.com/lewibs/usability-tracker#readme
- Issues: https://github.com/lewibs/usability-tracker/issues
- npm.io page: https://npm.io/package/usability-tracker

## Dependencies (2)

- [uuid](https://npm.io/package/uuid.md) ^8.3.2
- [lewibs-keylogger](https://npm.io/package/lewibs-keylogger.md) ^1.0.6

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2022-08-11
- 1.0.2 — 2022-08-11
- 1.0.1 — 2022-08-11
- 1.0.0 — 2022-08-11

## README

# usability-tracker
The goal of this application is to provide a method for automating the usability test process.
 
should eventually include all of these events in playback:
https://developer.mozilla.org/en-US/docs/Web/Events
 
## UserTracker
 
The module has only one export; it is the UserTracker class which is used to handle what is done each time an event is added to the history, what events to ignore, and what id to use when tracking the user.
 
```javascript
import UserTracker from "usability-tracker"
 
let user = new UserTracker(saveCallback, ignoreFilter, storageTag);
```
 
### methods
#### constructor(onUpdate, filter, storageTag)
| field | description |
| ----- | ----------- |
| onUpdate | is a callback for every time a new item is added to the log. |
| filter | example output of obj is a filter function that is used to determine if this log should be blocked from being added to the history |
| storageTag | this is the tag used to identify the user for multi page websites in localStorage. If unset it will be given custom tag defined internally |
 
#### get history(): [log]
returns the current total history
 
#### replay(history): undefined
| field | description |
| ----- | ----------- |
| history | an array of logs |
 
This simulates the user's actions on the screen.
 
<b>Warning: replay does not work as robustly as it could if an external program written with something, such as pyautogui, would work. This is due to events with isTrusted=false being ignored.</b>
 
#### toString(): String
returns a string of the history in json format
 
#### example log
This is an example of what a history log looks like:
```javascript
{
   "pressed": {
       "mousemove": true
   },
   "event": {
       "isTrusted": true,
       "key": "mousemove",
       "currentKey": "mousemove",
       "ratioX": 0.941696113074205,
       "ratioY": 0.750561797752809,
       "wheelRatioX": null,
       "wheelRatioY": null
   },
   "time": 1660187659423,
   "userID": "2cab6f8a-ffea-4f86-9a38-baea73735cfc",
   "type": "mousemove",
   "html": "<header class=\"App-header\"><img src=\"/static/media/logo.6ce24c58023cc2f8fd88fe9d219db6c6.svg\" class=\"App-logo\" alt=\"logo\"><p>Edit <code>src/App.js</code> and save to reload.</p><input type=\"password\"><input type=\"text\"><button id=\"alert\">alert</button></header>"
}
```

---
_Source: https://npm.io/package/usability-tracker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
