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

@situm/cordova-mrm-safety

v0.1.1

Published

Cordova wrapper for Android inertial events detection

Readme

License: MIT Cordova Latest version:

Getting Started

This plugin is intended to be integrated into a Cordova Android app together with @situm/cordova. The basic setup is described below.

Running the example

Check the example README to run a complete demo app using this plugin.

Requirements

  • Cordova CLI (npm i -g cordova)
  • Android platform added to the app (cordova platform add android)
  • Android SDK + JDK compatible with your Cordova setup
  • Situm Cordova plugin installed in host app: @situm/cordova

Install the plugin in a host Cordova app

Run all commands from your host Cordova app root.

  1. Install Situm plugin:
cordova plugin add @situm/cordova
  1. Install this plugin (Artifactory-backed dependency resolution):
cordova plugin add @situm/cordova-mrm-safety
  1. Build Android:
cordova build android

Minimal usage

Recommended order: start Situm positioning first, then start inertial detectors.

cordova.plugins.Situm.setUserPass(email, password);
cordova.plugins.Situm.requestLocationUpdates({
  buildingIdentifier: "YOUR_BUILDING_ID",
});

window.InertialEvents.onEvent((event) => {
  // event.type: "tap" | "fall" | "inactivity" | "error"
  // event.timestamp: epoch millis
  console.log("Inertial event", event);
});

window.InertialEvents.enableBackground();

window.InertialEvents.startTap({ taps: 3, sensitivity: 8 });
window.InertialEvents.startFall({ sensitivity: 0.5, lieTimeSec: 30 });
window.InertialEvents.startInactivity({
  sensitivity: 0.5,
  idleTimeSec: 30,
  ignoreHorizontal: true,
});

To stop:

window.InertialEvents.stopTap();
window.InertialEvents.stopFall();
window.InertialEvents.stopInactivity();
window.InertialEvents.stopAll();
cordova.plugins.Situm.removeUpdates();

Important behavior

Detectors may be running, but inertial callbacks are emitted only while Situm positioning is running (LocationManager.isRunning() == true).

Background Mode

To continue detecting emergency events even when the app is in the background, the screen is off, or the app has been minimized, you must enable Background Mode.

What does Background Mode do?

This mode starts a Foreground Service of type health.

Foreground Services are designed to perform ongoing operations that the user should be aware of. They display a persistent notification, giving the service higher priority so it can reliably detect emergency events in the background.

[!IMPORTANT]
This Foreground Service is used exclusively to detect potential emergencies that users may need to report, even when the app is not actively in use.

Permissions added automatically

When you add this plugin, the following permissions will be automatically added to your AndroidManifest.xml:

<uses-permission android:name="android.permission.HIGH_SAMPLING_RATE_SENSORS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_HEALTH" />

You don't need to require in runtime the before mentioned permissions as they are granted at install time.

Enable background inertial detection:

window.InertialEvents.enableBackground();
// then startTap/startFall/startInactivity

Disable background mode:

window.InertialEvents.disableBackground();

Notes:

  • Android will show a persistent foreground notification.
  • If the app task is removed from recent apps, the service stops.

Troubleshooting

  1. No inertial events are received

    • Verify Situm login succeeded and requestLocationUpdates(...) is active.
  2. Android permission errors

    • Grant runtime location/BLE permissions.

Versioning

This package is uploaded to npm as @situm/cordova-mrm-safety. To upload a new version, first make sure to update the "version" parameter at the package.json of the plugin so npm detects is a new version. You can update the plugin version by executing the command:

npm version patch # To upgrade the patch number of the version

Then, execute the following commands:

npm login # Login with the mobile account
npm pack --dry-run # To check out what will be pushed before actually uploading a new version
npm publish

License

This project is licensed under the MIT license.


More information

More info is available at our Developers Page.


Support information

For any question or bug report, please send an email to [email protected].