You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@openremote/rest

Package Overview
Dependencies
Maintainers
2
Versions
232
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openremote/rest

OpenRemote 3.x REST API

1.7.0
latest
npmnpm
Version published
Weekly downloads
477
-36.99%
Maintainers
2
Weekly downloads
 
Created
Source

@openremote/rest

NPM Version Linux Build Test Coverage

ES6 modules for connecting to an OpenRemote Manager as well as utilities for performing common tasks.

The default export is a singleton of type RestApi that can be used to communicate with the OpenRemote Manager REST API. It uses an axios client to perform the requests and it contains strongly typed definitions for each OpenRemote Manager REST API endpoint (JAX-RS resource).

Install

npm i @openremote/rest
yarn add @openremote/rest 

Usage

For a full list of properties, methods and options refer to the TypeDoc generated documentation.

If used in conjunction with @openremote/core and the Manager init method has been called then the default export will be ready to use, the endpoints can be accessed via the RestApi api property and each JAX-RS resource defined in the OpenRemote Manager is also defined with the same name in the RestApi object.

import openremote from "@openremote/core";
import rest from "@openremote/rest";

openremote.init({
    ...
}).then((success) => {
    if (success) {
        let assetQuery = ...;
        let response = await rest.api.AssetResource.queryAssets(assetQuery);
        let assets = response.data;
        
        // Do something with the assets
    } else {
        // Something has gone wrong
    }
});

It is possible to add additional request interceptors by calling the addRequestInterceptor method, it is also possible to access the AxiosInstance by calling the axiosInstance property.

It is also possible to instantiate the RestApi object on demand but note you will need to ensure the Authorization header is correctly set if calling secure endpoints on the OpenRemote Manager REST API.

import {RestApi} from "@openremote/rest";

let rest = new RestApi();
rest.setTimeout(10000);
rest.addRequestInterceptor(...);
rest.initialise();

Supported Browsers

The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition, Internet Explorer 11 is also supported.

License

GNU AGPL

FAQs

Package last updated on 07 Jul 2025

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.