npm.io
2.187.3 • Published yesterday

node-opcua-client

Licence
MIT
Version
2.187.3
Deps
44
Size
1.4 MB
Vulns
0
Weekly
0
Stars
1.7K

node-opcua-client

NPM version NPM downloads CI

Lightweight OPC UA client for Node.js — connect to any OPC UA server, browse, read, write, and subscribe to data changes.

Part of the node-opcua project — the most popular OPC UA stack for Node.js.

When to use this package

Package Use case
node-opcua-client You only need client capabilities (smaller install, faster startup)
node-opcua You need both client and server in the same project

Quick Start

npm install node-opcua-client

Requires Node.js 20 or later.

Connect, read, and disconnect
import {
  OPCUAClient,
  AttributeIds,
  DataValue,
} from "node-opcua-client";

(async () => {
  // 1. Create a client and connect to an OPC UA server
  const client = OPCUAClient.create({ endpointMustExist: false });
  await client.connect("opc.tcp://opcuademo.sterfive.com:26543");

  // 2. Create a session
  const session = await client.createSession();

  // 3. Read the server's current time (ns=0;i=2258)
  const dataValue: DataValue = await session.read({
    nodeId: "ns=0;i=2258",
    attributeId: AttributeIds.Value,
  });
  console.log("Server time:", dataValue.value.value);

  // 4. Clean up
  await session.close();
  await client.disconnect();
})();

Documentation

Professional Support

Feature Community (GitHub) Professional (Sterfive)
Bug reports via GitHub Issues
CVE security advisories After disclosure Early access — patch before public disclosure
Priority response time —
Private support channel —
Architecture & code review —
Dedicated consulting hours —
Certifiable version —

Professional Support

Contact: contact@sterfive.com

Sponsors

If you find this package valuable, please consider supporting the project:

Your sponsorship ensures long-term maintenance, new features, and continued OPC Foundation representation.

License

MIT — Copyright 2014-2026 Etienne Rossignon / Sterfive SAS

Keywords