Skip to content
Use with AI

Node.js SDK ​

Connect a Node.js application to Robot Runtime through the binary Protobuf WebSocket gateway. Use discovery, status, streams and request-based operations from one client.

Installation ​

On a prepared kit PC, first check the supplied software inventory. Clone the dev branch of the Quickstarts repository or open the delivered Node quickstart folder. Use Node.js 24 LTS and npm. For the Git option:

powershell
git clone --branch dev --single-branch https://bitbucket.org/fruitcore/plexa-runtime-quickstarts.git

Then open the clone’s node/ folder or the delivered Node folder and run:

powershell
npm ci
npm run testkit

The Node folder contains SDK 0.1.0, Testkit 0.5.1, examples and a lockfile. npm ci installs the included packages and their third-party dependencies using the npm registry or your local cache.

First status read — local fixture ​

Keep the Testkit terminal running. In a second terminal in the same folder, run npm run status; for JavaScript, use npm run status:js. The example checks Runtime API 0.9.0 and requires HORST600_S5. The client lifecycle is:

ts
import { createNodeRobotRuntimeClient } from '@plexa/robot-runtime-sdk';

const client = createNodeRobotRuntimeClient('ws://127.0.0.1:18041/ws/runtime');
await client.connect();
try {
  const robots = await client.listRobots();
  if (robots.length !== 1) throw new Error('Expected one local fixture robot');
  const robot = robots[0];
  console.log('Robot:', robot.name);
  console.log('Joints in degrees:', await client.getCurrentRobotJoints(robot.name));
} finally {
  client.close();
}

The result is a fixture robot and its joint values, followed by a closed connection. The loopback address connects to test data, not to your physical robot. For your system, use the delivered connection configuration and verify robot identity explicitly.

Continue with your application ​

Joint angles use degrees, Cartesian positions millimetres. Keep Runtime errors and stream cancellation visible in your application.

Node.js / TypeScript API reference · Control API · Kit preparation

VS Code tutorial ​

Open the Node quickstart in VS Code: install the editor, debug a status read, inspect variables and run the fixture tests. The step-by-step guide includes screenshots and troubleshooting for Windows.