
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
node-smartplay
Advanced tools
node-smartplay lets you discover and interact with LEGO Smart Play devices over Bluetooth Low Energy.
Currently supports the Smart Brick (audio-equipped brick). Additional device types will be supported as they are discovered.
const { SmartPlay } = require("node-smartplay");
const smartPlay = new SmartPlay();
smartPlay.on("discover", async (device) => { // Wait to discover a device
console.log("Found device, connecting...");
await device.connect();
const info = device.info;
console.log(` Name: ${info.name}`);
console.log(` Model: ${info.model}`);
console.log(` Firmware: ${info.firmware}`);
console.log(` MAC: ${info.mac}`);
console.log(` Battery: ${device.battery}%`);
console.log(` Volume: ${device.volume}`);
await device.setVolumeLow(); // Set volume to low (10)
console.log("Volume set to low");
device.disconnect();
});
smartPlay.scan(); // Start scanning for Smart Play devices
console.log("Scanning for Smart Play devices...");
More examples in the examples/ directory.
Node.js v18+ required.
npm install node-smartplay --save
node-smartplay uses @stoprocent/noble for BLE. See noble prerequisites.
| Method | Description |
|---|---|
scan() | Start scanning for Smart Play devices. |
stop() | Stop scanning. |
getDevice(uuid) | Get a discovered device by UUID. |
getDevices() | Get all discovered devices. |
| Event | Description |
|---|---|
discover | Emitted when a device is found. Provides a SmartBrickDevice instance. |
| Method | Description |
|---|---|
connect() | Connect and perform the handshake sequence. |
disconnect() | Disconnect from the device. |
readBattery() | Read the current battery level (%). |
readVolume() | Read the current volume level. |
readModel() | Read the device model name. |
readFirmwareRevision() | Read the firmware version string. |
setVolume(level) | Set volume to a VolumeLevel value. |
setVolumeHigh() | Set volume to high (100). |
setVolumeMedium() | Set volume to medium (40). |
setVolumeLow() | Set volume to low (10). |
setName(name) | Set the device name (max 12 bytes UTF-8). |
readRawRegister(register) | Read a raw register value for exploration. |
| Property | Type | Description |
|---|---|---|
battery | number | Current battery level (%). |
volume | number | Current volume level. |
connected | boolean | Whether the device is connected. |
info | SmartBrickInfo | Device identity (name, model, firmware, MAC, UUID). |
| Event | Description |
|---|---|
battery | Emitted when the battery level changes. |
volume | Emitted when the volume changes. |
connectionState | Emitted when the charging/connection state changes. |
disconnect | Emitted when the device disconnects. |
| Device | Status | Notes |
|---|---|---|
| Smart Brick | Supported | Battery, volume, naming, device info. Authentication not yet supported (requires LEGO backend signing). |
Authentication — ECDSA P-256 challenge-response requires LEGO's backend signing server. Device info, volume, and naming work without auth. Firmware updates and factory reset require it.
Docked only — Devices are only connectable while on the charging base. Undocked, they use BLE 5.4 PAwR for device-to-device play and aren't visible to BLE scanners.
Rotating BLE addresses — The stable identifier is the MAC address, available via device.info.mac after connecting.
Linux permissions — You may need to grant node access to the Bluetooth adapter.
The notes/ directory contains reverse engineering documentation for the Smart Play BLE protocol, hardware, backend API, and file transfer system.
npm install
npm run build
FAQs
A JavaScript/TypeScript module for LEGO Smart Play BLE devices
We found that node-smartplay demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.