npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@futurae-public-js/browser-sensor-js

v1.0.4

Published

Browser Sensor JavaScript Library

Downloads

119

Readme

browser-sensor-js

JavaScript library used client-side for browser behaviour collection (mouse, keyboard, fingerprint, etc.).

Building browser-sensor.min.js

To build the minified bundle we use webpack. In the root folder you will find:

  • package.json, includes all necessary npm scripts and packages
  • webpack.config.js, includes all necessary configuration options and plugins

To install all necessary packages run:

yarn

To build for development with watch mode:

yarn build:dev

To build a production bundle:

yarn build

The bundle is placed under dist/browser-sensor.min.js.

Test locally

  • Create a bundle with yarn build
  • Run a server with npx serve
  • Open http://localhost:3000 in the browser
  • Interact with the page and check the Network tab to see the outgoing observation payloads

Usage

Install

npm install @futurae-public-js/browser-sensor-js

Or load the UMD bundle directly in HTML:

<script src="node_modules/@futurae-public-js/browser-sensor-js/dist/browser-sensor.min.js"></script>

Init

Call init() once when your page loads. All fields except sessionId, collector, storage, and processor are required.

import browserSensor from '@futurae-public-js/browser-sensor-js';

browserSensor.init({
  baseURL:   'https://your-collection-endpoint/api/v1/observations',
  accountID: 'your-account-id',
  appID:     'your-app-id',
});

When using the UMD bundle the library is exposed as window.browserSensor.default:

window.browserSensor.default.init({ ... });

Config options

| Option | Type | Default | Description | |---|---|---|---| | baseURL | string | — | Endpoint that receives the observation POSTs | | accountID | string | — | Your account identifier | | appID | string | — | Your application identifier | | authToken | string | — | Authorization token sent in the Authorization header | | sessionId | string | auto-generated | Override the session ID (stored in sessionStorage otherwise) | | collector.features | string[] | all features | Subset of features to collect | | storage.keyPrefix | string | __fut_bs_ | Prefix for localStorage keys | | processor.processInterval | number | 1000 | How often (ms) collected data is sent |

API

// Get the current session ID
browserSensor.getSessionId();

// Get the raw collected events (array)
browserSensor.getData();

// Get the transformed/mapped observation object
browserSensor.getTransformedData();

// Stop collecting and processing
browserSensor.stop();

Collected features

By default the library collects all of the following:

| Key | Description | |---|---| | mm | Mouse move timestamps and coordinates | | mu | Mouse up timestamps and coordinates | | md | Mouse down timestamps and coordinates | | kp | Key press durations (down/up pairs) | | fp | Browser fingerprint | | window_init | Window dimensions at initialisation | | window_resize | Window resize events | | input_form_focus | Input/textarea focus events | | input_form_blur | Input/textarea blur events |

To collect only a subset pass a collector.features array using the feature key strings above:

browserSensor.init({
  // ...
  collector: {
    features: ['mm', 'kp', 'fp'],
  },
});

Environments

Environment variables for each build target are stored in .env-cmdrc.json. To add a new environment, add a key there and build with:

yarn env-cmd -e staging webpack