Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
fastar-logger
Advanced tools
Readme
FastarLogger is a JavaScript library used to record mouse events and events from device sensors (accelerometer, gyroscope). It allows to log pressing and releasing mouse buttons (left, middle, right, forward and back), mouse movements, angular velocity and acceleration of the device along all three axes. For easy and fast integration we recommend to use behalearn - server app as a backend server.
Download | Description |
---|---|
FastarLogger | Beta version of FastarLogger |
Inside the archives downloaded from the above link, you will see following files:
fastar-logger.min.js
- This is the minified library JavaScript code.fastar-logger.min.js.map
- This file maps the minified file to original source code.fastar-logger.js
- This is the readable, unminified JavaScript library.fastar-logger.js.map
- This file maps the unminified file to original source code.Unzip the downloaded archive to your website’s directory and add this to the head of your HTML code:
<script src="/path/to/fastar-logger.js"></script>
Now you can use FastarLogger on your webpage like this:
<script>
let config = {apiUrl: 'https://your-domain.com'};
let logger = new fastarLogger.Logger(config);
logger.init().then(
() => logger.startLogging()
);
</script>
If you use the npm package manager, you can fetch a local copy of FastarLogger by running:
npm install fastar-logger
FastarLogger is written using ES2015 modules. To import specific FastarLogger Module into an ES2015 application (Logger in this case):
import {Logger} from "fastar-logger";
Or import everything into a namespace:
import * as fastarLogger from "fastar-logger";
In Node:
var fastarLogger = require("fastar-logger");
To run logger, you need to create a logger instance with its configuration. You have to define base endpoint URL in the configuration. This endpoint is used to sent recorded data and receive a unique session ID.
You can create logger instance like this:
let logger = new Logger({
apiUrl: 'https://your-domain.com'
})
You can configure more properties in configuration object. For example you can specify which events you want to be logged. Check documentation for more information.
Now you can initialize new session. When you initialize session, logger will obtain unique session ID. The session ID is part of each recorded log.
logger.init();
To start logging you need to call startLogging()
function like this:
logger.startLogging();
To start logging immediately after session is initialized:
logger.init().then(
() => logger.startLogging()
);
If you want to stop logging data you can simply call stopLogging()
function.
logger.stopLogging();
If you want to log custom data you can do it like this:
logger.logCustomEvent({
action: 'login',
name: 'John',
})
Bellow you can see example of mousemove
event log:
{
eventType: 'MOUSE_MOVE',
payload: {
mouseButton: 'NO_BUTTON',
positionX: 1123,
positionY: 547,
},
sessionId: '5c70579af2307d000b7eaf0c',
sessionStartsAt: 1550866331396,
time: 7683.980000088923,
};
For more information see FastarLogger documentation and API documentation.
npm install
to get the project's dependenciesnpm run build
to produce minified version of the library.npm run dev
. This command will generate an non-minified version of the library and will run a watcher so you get the compilation on file change.npm run test
to run testsnpm run build
- produces production version of the library under the lib
foldernpm run dev
- produces development version of the library and runs a watchernpm run test
- runs the testsnpm run test:watch
- same as above but in a watch modenpm run demo
- runs demo page to show logger in actionnpm run doc
- generates JSDoc API documentationSource code is provided under MIT License.
FAQs
Library for logging mouse and mobile events
The npm package fastar-logger receives a total of 4 weekly downloads. As such, fastar-logger popularity was classified as not popular.
We found that fastar-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.