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

geotab-smart-sdk

v0.5.2

Published

A smart, composable Node.js SDK for the MyGeotab API — built on top of mg-api-js with adaptive feeds, named diagnostics, and use-case-driven helpers.

Downloads

1,050

Readme

geotab-smart-sdk

npm License Node Tests Coverage Docs CI Sponsor

A smart, composable Node.js SDK for the MyGeotab API, built on top of mg-api-js. Adaptive feeds, named diagnostics, two complementary trackers, group filtering, and a sandboxed playground — without locking you out of raw call() / multiCall().

Looking for the full guide, comparisons, or an interactive playground?kunalkamble.github.io/geotab-smart-sdk


Install

npm install geotab-smart-sdk

Requires Node.js ≥ 20. The peer mg-api-js is installed automatically.


Quick start

const { GeotabSDK, Diagnostics } = require('geotab-smart-sdk');

const sdk = new GeotabSDK({
  username: '[email protected]',
  password: 'secret',
  database: 'my_company',
});

async function main() {
  await sdk.connect({ cacheDevices: true });

  // Live tracking with bearing + fuel level — one multiCall per 5s poll
  const tracker = sdk.liveTracker()
    .withDiagnostics([Diagnostics.FUEL_LEVEL])
    .withFaults()
    .pollEvery(5_000);

  tracker.on('update', (vehicles) => {
    for (const v of vehicles) {
      console.log(v.device.name, v.location.bearing, v.diagnostics);
    }
  });

  await tracker.start();
}

main().catch((err) => { console.error(err); process.exit(1); });

What's in the box

| Helper | Purpose | |---|---| | sdk.liveTracker() | Real-time tracking via DeviceStatusInfo (bearing/driver native) | | sdk.realtimeTracker() | High-fidelity tracking via LogRecord GetFeed (derives bearing/isDriving) | | sdk.history() / historyMany() / historyByGroups() | Historical GPS + diagnostics + faults + trips | | sdk.fleetSnapshot() | Whole-fleet point-in-time picture with pre-computed summary | | sdk.feeds() | Adaptive GetFeed streaming with crash-safe version tokens | | sdk.call() / sdk.multiCall() | Direct API access — auto re-auth + rate-limit retry | | Diagnostics.*, DiagnosticGroups.* | Named constants so you never type 'DiagnosticFuelLevelId' again |

Plus: session persistence (skip the password on resume), readOnly: true mode for sandboxed UIs, group filtering across every helper, and a RateLimiter that honors Retry-After.


Full documentation

Everything is on the live docs site:

  • Guide — prose reference: setup, sessions, group filtering, errors, GetFeed rules, testing
  • Smart SDK Inspector — interactive use cases, helper map, cheat sheet, side-by-side vs raw API
  • Raw API Inspector — entity-level reference for mg-api-js users
  • Compare — feature-by-feature comparison with raw mg-api-js
  • Playground — exercise the SDK against your fleet with credentials you supply; runs in readOnly mode by policy

Examples

Runnable Node examples live in examples/. Each reads credentials from process.env:

export GEOTAB_USER='[email protected]'
export GEOTAB_PASS='secret'
export GEOTAB_DB='my_company'

node examples/live-tracking.js
node examples/realtime-tracking.js
node examples/historical-gps-diagnostics.js
node examples/fleet-snapshot.js
node examples/continuous-feed-sync.js

Requirements

  • Node.js ≥ 20 (uses node:test + built-in coverage)
  • A valid MyGeotab account
  • For high-volume GetFeed, a root-group service account is recommended

Testing

npm test               # spec reporter
npm run test:watch     # dev loop
npm run test:coverage  # 84% lines, 80% branches, 75% functions

89 tests across 8 files using Node 20's built-in test runner — zero test-framework dependencies. CI gates the docs deploy on tests + lint.


Sponsor

If this SDK has saved you time, consider sponsoring on GitHub — open source, MIT licensed, maintained on personal time. A star on the repo is honestly just as appreciated. See the Sponsor page for ways to help.


License

MIT — see LICENSE.