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

@edgeberry/device-sdk

v3.5.3

Published

Node.js SDK for interfacing applications with the Edgeberry Device Software over D-Bus

Readme

Edgeberry Banner

@edgeberry/device-sdk

Node.js SDK for interfacing applications with the Edgeberry Device Software over D-Bus. Provides a small, typed API for sending telemetry, publishing application info/status, triggering device identification, and subscribing to cloud-to-device messages.

This is the Node counterpart to the Python edgeberry SDK, and is the same client used by the @edgeberry/device-node-red-contrib Node-RED node.

Installation

npm install @edgeberry/device-sdk

The SDK talks to the io.edgeberry.Core service on the D-Bus system bus, which is where the Edgeberry Device Software registers itself. It is intended to run on the same host as the Edgeberry Device Software.

Quick start

import { Edgeberry } from '@edgeberry/device-sdk';

const edge = new Edgeberry();

await edge.setApplicationInfo({
  name: 'my-app',
  version: '1.0.0',
  description: 'My Edgeberry application',
});

await edge.setApplicationStatus({ level: 'ok', message: 'Running fine' });

await edge.sendMessage({ temperature: 22.5, humidity: 45 });

await edge.onCloudMessage((payload) => {
  console.log('Cloud says:', payload);
});

CommonJS is fully supported:

const { Edgeberry } = require('@edgeberry/device-sdk');
const edge = new Edgeberry();

API

new Edgeberry(options?)

Creates a client. The D-Bus connection is opened lazily on the first call.

| Option | Type | Default | Description | |--------|------|---------|-------------| | bus | 'system' \| 'session' | 'system' | Which D-Bus to connect to. Use 'session' only for local testing. |

identify(): Promise<void>

Triggers the on-device physical identification routine (LED blink + beep).

setApplicationInfo(info): Promise<string>

Publishes application metadata to the Device Hub.

await edge.setApplicationInfo({ name, version, description });

Returns the Core service's raw response string ('ok' on success).

setApplicationStatus(status): Promise<string>

Publishes an application health/status update. Accepts either an object or positional args (for parity with the Python SDK):

await edge.setApplicationStatus({ level: 'ok', message: 'All good' });
await edge.setApplicationStatus('warning', 'Sensor reading noisy');

sendMessage(data): Promise<string>

Sends telemetry / a cloud-bound message. Returns the raw response string from the Core service:

| Response | Meaning | |----------|---------| | 'ok' | Sent | | 'err:not_initialized' | Device Hub client is not initialized yet | | 'err:not_connected' | Device Hub is unreachable | | 'err:invalid_data' | Payload could not be serialized |

onCloudMessage(handler): Promise<() => void>

Subscribes to the CloudMessage D-Bus signal (messages coming from the cloud to this device). The JSON payload is parsed before being handed to the handler. Returns an unsubscribe function.

const unsubscribe = await edge.onCloudMessage((payload) => {
  console.log('Cloud message:', payload);
});

// later
unsubscribe();

onButtonEvent(handler): Promise<() => void>

Subscribes to hardware button events emitted by the device. The handler receives { event, timestamp }, where event is one of:

| Event | Duration | Notes | |-------|----------|-------| | click | < ~1.7 s | short press | | pressrelease | ~1.7 s - 2.5 s | long press | | apToggle | ~3 s | toggles WiFi provisioning AP mode | | longpress | 5 s+ | triggers a device restart | | verylongpress | 10 s+ | reserved for factory reset |

const unsubscribe = await edge.onButtonEvent(({ event, timestamp }) => {
  if (event === 'click') console.log('button clicked at', timestamp);
});

onState(handler): Promise<() => void>

Subscribes to device state updates (system / connection / application sections). Fires whenever any part of the state changes.

await edge.onState((state) => {
  console.log('wifi:', state.connection.wifi, 'cloud:', state.connection.connection);
});

getState(): Promise<DeviceState>

Fetch the current device state on demand, without waiting for the next StateUpdate signal.

const state = await edge.getState();
console.log(state.system.state, state.system.version);

close(): void

Releases the underlying D-Bus connection. Safe to call multiple times.

D-Bus surface

The SDK is a thin wrapper over the following D-Bus surface exposed by the Edgeberry Device Software:

  • Service: io.edgeberry.Core
  • Object path: /io/edgeberry/Core
  • Interface: io.edgeberry.Core
  • Methods: Identify(), SetApplicationInfo(s) -> s, SetApplicationStatus(s) -> s, SendMessage(s) -> s, GetState() -> s
  • Signals: CloudMessage(s), ButtonEvent(s), StateUpdate(s)

You can inspect it directly with dbus-send / busctl for debugging.

Version compatibility

The SDK version tracks the Edgeberry Device Software version. Use the SDK version that matches the device software running on your device.

License

MIT © Sanne 'SpuQ' Santens. The Rules & Guidelines apply to the usage of the Edgeberry™ brand.