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

rtls-sdk

v0.6.2-alpha.0

Published

TypeScript SDK for the RTLS REST API (async, isomorphic port of the Python rtls-sdk)

Readme

rtls-sdk (TypeScript)

An async, isomorphic (Node + browser) TypeScript port of the Python rtls-sdk. The wire protocol is identical; the surface is idiomatic TS: every method returns a Promise, models are zod-validated and frozen, and the original server payload is available on .raw.

Status: feature-complete port. All 28 resource sub-clients, the compound sagas (tags/zones/groups/nodes/users/auth/system), the async pagination + reports (PWS/heatmap/CSV), the context aggregation, lsb orchestration, and the WebSocket streaming layer are ported and tested.

Documentation

Full documentation lives in docs/: install, quickstart, per-entity pages (overview), guides (errors, pagination, scopes, timestamps, compound workflows…), and advanced topics. The generated API reference is in docs/api/ (regenerate with npm run docs:api).

Resources

client. exposes: tags, sites, areas, floorplans, anchors, zones, groups, nodes, anchorAssociations, tagAssociations, users, projects, companies, alarms, events, reports, notifications, subscribers, auth, system, context, messaging, userMessages, logger, schedules, lsb, network, ws.

Stack

| Concern | Choice | |---|---| | HTTP | ky (fetch-based; Node ≥18 + browser) | | Validation / models | zod via a defineModel / fromWire helper | | Auth | lazy login + single 401-replay, coalesced through one in-flight promise | | Tests | vitest + msw (HTTP mocking) | | Build | tsup (ESM + CJS + .d.ts) |

Naming

Canonical field names are camelCase (idiomatic TS): the wire key notification_type surfaces as notificationType, location_uidsiteUid, sublocation_uidareaUid, macmacAddress. The untouched wire payload is always on .raw. (This differs from the Python SDK's snake_case surface — a deliberate idiom choice, revisit if strict cross-language parity is preferred.)

Example

import { RtlsClient } from "rtls-sdk";

const client = new RtlsClient({
  username: process.env.RTLS_USERNAME!,
  password: process.env.RTLS_PASSWORD!,
  baseUrl: process.env.RTLS_BASE_URL!,
  projectUid: process.env.RTLS_PROJECT_UID,
});

// Reads return frozen, typed models (wire keys mapped to camelCase).
const tags = await client.tags.list();

// Lazy pagination — HTTP fires only as you iterate; `break` stops early.
for await (const event of client.events.iterPws({ tagUids: "t-1", start, end })) {
  console.log(event.tagUid, event.zoneUid);
}

// Live WebSocket stream.
const session = await client.ws.subscribe(["pos", "alarm"]);
for await (const msg of session) {
  if (msg.channel === "pos") console.log((msg as any).tagUid);
  break;
}
session.close();

client.close();

See examples/quickstart.ts for a runnable script.

Scripts

npm run typecheck   # tsc --noEmit (strict)
npm test            # vitest run (offline, msw mocks)
npm run test:live   # live suite against a real server (needs RTLS_LIVE_* / RTLS_* env)
npm run lint        # eslint
npm run build       # tsup → dist/
npm run docs:api    # typedoc → docs/api/