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

@empa-electronics/tiremo-sdk-client-node

v0.1.5

Published

Node.js client for the TIREMO SDK REST and live WebSocket APIs

Downloads

60

Readme

@empa-electronics/tiremo-sdk-client-node

Node.js client for the TIREMO SDK. Uses native fetch (Node 18+) and native WebSocket (Node 22+).

Documentation

| Topic | Link | | --- | --- | | SDK Live Data | docs.tiremo.ai/developer-guide/sdk-live-data | | API Key Security | docs.tiremo.ai/developer-guide/sdk-api-key-security | | HTML examples | TIREMO-SDK/examples |

Getting started

1. Install

npm install @empa-electronics/tiremo-sdk-client-node

Requires Node.js 18+ for REST. Live WebSocket requires Node.js 22+.

2. Get an API key

Create a product-scoped API key in the Tiremo Platform Administration → API Credentials UI.

Use a secret key for backend services and scripts. Use createToken() + connectWithToken() when fronting browser clients so the secret never leaves your server.

3. Create a client

import { TiremoClient } from "@empa-electronics/tiremo-sdk-client-node";

const client = new TiremoClient({
  baseUrl: "https://sdk.tiremo.ai",
  apiKey: process.env.TIREMO_API_KEY!,
});

4. Choose a live connection mode

| Mode | When to use | | --- | --- | | connectWithSecretKey() | Trusted server scripts, workers, integrations | | createToken() + connectWithToken() | BFF/API that serves browser clients |

Usage examples

TiremoClient — REST

devices.getTelemetryLatest(deviceIdentifier, options?)

const latest = await client.devices.getTelemetryLatest("cameradevice9", {
  keys: ["temperature"],
});

console.log(latest.deviceIdentifier, latest.timestamp, latest.data);

live.createToken()

Mint a browser-safe token from your API route:

const { token, expiresAt } = await client.live.createToken();

// return token to caller
return Response.json({ token, expiresAt });

live.connectWithToken(token)

const live = client.live.connectWithToken(token);
live.connect();

live.connectWithSecretKey()

Direct WebSocket auth with the secret key (server-side only):

const live = client.live.connectWithSecretKey();
live.connect();

TiremoLiveClient — WebSocket

connect() / disconnect()

live.connect();
// ...
live.disconnect();

on(event, handler)

live.on("connected", () => {
  live.subscribeTelemetry({
    id: "temp",
    deviceIdentifier: "cameradevice9",
    keys: ["temperature"],
  });
});

live.on("telemetry", (event) => {
  console.log(event.deviceIdentifier, event.data);
});

live.on("presence", (event) => {
  console.log(event.deviceIdentifier, event.isOnline, event.lastSeenAt);
});

live.on("alarm", (event) => {
  console.log(event.alarmType, event.severity);
});

live.on("error", (event) => {
  console.error(event.code, event.message);
});

// Returns unsubscribe function
const off = live.on("message", (event) => console.log(event.type));
off();

subscribeTelemetry({ id, deviceIdentifier, keys? })

live.subscribeTelemetry({
  id: "temp-sub",
  deviceIdentifier: "cameradevice9",
  keys: ["temperature", "humidity"],
});

subscribePresence({ id, deviceIdentifier })

live.subscribePresence({
  id: "presence-sub",
  deviceIdentifier: "cameradevice9",
});

subscribeAlarm({ id, deviceIdentifier })

live.subscribeAlarm({
  id: "alarm-sub",
  deviceIdentifier: "cameradevice9",
});

unsubscribe(subscriptionId)

live.unsubscribe("temp-sub");

Full example (server script)

import { TiremoClient } from "@empa-electronics/tiremo-sdk-client-node";

const client = new TiremoClient({
  baseUrl: "https://sdk.tiremo.ai",
  apiKey: process.env.TIREMO_API_KEY!,
});

const latest = await client.devices.getTelemetryLatest("cameradevice9", {
  keys: ["temperature"],
});
console.log("Latest:", latest.data);

const live = client.live.connectWithSecretKey();

live.on("connected", () => {
  live.subscribeTelemetry({
    id: "temp",
    deviceIdentifier: "cameradevice9",
    keys: ["temperature"],
  });
});

live.on("telemetry", (event) => {
  console.log("Live:", event.data);
});

live.connect();

Related packages

| Package | Use case | | --- | --- | | @empa-electronics/tiremo-sdk-client-js | Browser / bundler | | tiremo-sdk-client | Python |

License

ISC — Empa Electronics