This library provides an idiomatic TypeScript client for working with the Wandelbots NOVA robotics software platform API.
npm install @wandelbots/nova-jsIf you develop a React application we also provide a set of React components. It includes a Robot Jogging Panel, a Robot Visualization and other useful UI widgets.
The core of this package is the Nova client, which represents a connection to a given NOVA instance:
import { Nova } from "@wandelbots/nova-js/v2"
const nova = new Nova({
instanceUrl: "https://example.instance.wandelbots.io",
// Access token is given in the developer portal UI when you create an instance
// This can be omitted when the frontend is hosted by the instance itself
// (i.e. when running as a NOVA app)
accessToken: "...",
})You can make calls to the REST API via nova.api, which contains a bunch of namespaced methods for each endpoint generated from the OpenAPI spec and documentation.
For example, to list the controllers configured in your cell:
const controllerIds = await nova.api.controller.listRobotControllers("cell")
// -> e.g. ["ur5e", ...]Documentation for the various API endpoints is available on your Nova instance at /api/v2/ui or on portal.wandelbots.io
Nova has various convenience features for websocket handling in general. Use openReconnectingWebsocket to get a persistent socket for a given Nova streaming endpoint that will handle unexpected closes with exponential backoff:
const joggingWebsocket = nova.openReconnectingWebsocket(`/cells/cell/controllers/ur5e/execution/jogging`)
joggingWebsocket.addEventListener("message", (ev) => {
console.log(ev.data)
})Websockets on a given NOVA client are deduplicated by path, so if you call openReconnectingWebsocket twice with the same path you'll get the same object. The exception is if you called dispose, which you may do to permanently clean up a reconnecting websocket and free its resources:
joggingWebsocket.dispose()If you would like to contribute a change to this repository, see CONTRIBUTING.md.