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

@totemsdk/edge-matter

v0.1.0

Published

Edge runtime adapter for Matter — smart home, multi-transport, fabric management

Readme

@totemsdk/edge-matter

Edge runtime adapter for Matter — smart home, multi-transport, fabric management.

Install

npm install @totemsdk/edge-matter

Design

This package does not import the Matter SDK or any native bindings. All Matter behaviour is injected via MatterTransportPort. The package handles commissioning, attribute read/write, subscriptions, command invocation, and proof generation.

Quick start

import { createEdgeRuntime, createEdgeDevice, createCapabilitySet } from '@totemsdk/edge';
import { createMatterGateway, createMatterSensorBridge } from '@totemsdk/edge-matter';
import type { MatterTransportPort } from '@totemsdk/edge-matter';

// 1. Implement MatterTransportPort (e.g. using Matter SDK Node.js bindings)
const transport: MatterTransportPort = {
  async init(vendorId, productId) { /* initialise Matter stack */ },
  async shutdown() { /* shutdown */ },
  async commission(device, setupCode) { /* commission device onto fabric */ return { nodeId: '', vendorId: 0, productId: 0, endpoints: [] }; },
  async decommission(nodeId) { /* remove from fabric */ },
  async readAttribute(nodeId, endpointId, clusterId, attributeId) { /* read attribute */ return { nodeId, endpointId, clusterId, attributeId, value: null, dataType: '', receivedAt: Date.now() }; },
  async writeAttribute(nodeId, endpointId, clusterId, attributeId, value) { /* write attribute */ },
  async subscribe(nodeId, endpointId, clusterId, attributeIds, minInterval, maxInterval) { /* subscribe to attribute changes */ return { onChange(handler) { return () => {}; }, async cancel() {} }; },
  async invokeCommand(nodeId, endpointId, clusterId, commandId, args) { /* invoke command */ return null; },
  onCommissioned(handler) { return () => {}; },
  onError(handler) { return () => {}; },
};

// 2. Wire into Edge runtime
const runtime = createEdgeRuntime({
  deviceId: 'matter-gateway-01',
  capabilities: createCapabilitySet(['transport:matter', 'proof:create']),
  ports: { /* proof port */ },
});

// 3. Create gateway with attribute subscriptions
const gateway = createMatterGateway({
  runtime,
  transport,
  vendorId: 0xFFF1,
  productId: 0x0001,
  subscriptions: [
    { nodeId: 'abc123', endpointId: 1, clusterId: 0x0402, attributeIds: [0x0000], sensorId: 'temp-sensor', minInterval: 1, maxInterval: 60 },
    { nodeId: 'abc123', endpointId: 1, clusterId: 0x0405, attributeIds: [0x0000], sensorId: 'humidity-sensor', minInterval: 1, maxInterval: 60 },
  ],
});
await gateway.start();
// Attribute changes are automatically sent to the proof port

// 4. Commission a device
const result = await gateway.commission(3840, '34970112332');
console.log(result.data?.node);

// 5. Read an attribute
const temp = await gateway.readAttribute('abc123', 1, 0x0402, 0x0000);
console.log(temp.data?.value);

// 6. Write an attribute
await gateway.writeAttribute('abc123', 1, 0x0006, 0x0000, 1); // on/off cluster, on

// 7. Invoke a command
await gateway.invokeCommand('abc123', 1, 0x0006, 0x0001, {}); // on/off cluster, off command

// 8. Or use the sensor bridge for polling
const bridge = createMatterSensorBridge({
  runtime,
  transport,
  gateway,
  bindings: [
    { sensorId: 'living-room-temp', nodeId: 'abc123', endpointId: 1, clusterId: 0x0402, attributeId: 0x0000, intervalMs: 30000, dataType: 'temperature', unit: '°C' },
  ],
});
await bridge.start();

Common Matter clusters

| Cluster ID | Name | Description | |-----------|------|-------------| | 0x0006 | On/Off | Basic on/off control | | 0x0008 | Level Control | Dimming | | 0x0201 | Thermostat | HVAC control | | 0x0402 | Temperature Measurement | Temperature sensor | | 0x0405 | Relative Humidity Measurement | Humidity sensor | | 0x0406 | Occupancy Sensing | Presence detection | | 0x040D | Air Quality | Air quality sensor | | 0x0500 | Identify | Device identification |

Commissioning

Matter uses a setup code (11 or 21 digits) printed on the device or QR code. The discriminator (12-bit) is embedded in the setup code. Pass both to gateway.commission().

Capabilities

  • transport:matter — required for Matter transport

License

MIT