1.8.3 • Published 2 years ago

@iotflows/iotflows-smart-widget v1.8.3

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

iotflows-smart-widget

https://iotflows.com

IoTFlows Smart Widget React Component.

With Smart Widget, you can create various real-time and historical widgets. Each Smart Widget requires a smart_widget_uuid and a asset_uuid.

Installation

Use npm to install the iotflows.js module:

npm install @iotflows/iotflows-smart-widget --save

Usage

import SmartWidget from '@iotflows/iotflows-smart-widget/dist/components/SmartWidget'

function App() {
  return (
    <div className="App">
      <Container>                  
        <SmartWidget
            username='CLIENT_ID'
            password='CLIENT_SECRET'
            widget_uuid='wdg_xxxxxxxxxxxxxxxxxxxxxx'
            asset_uuid='as_xxxxxxxxxxxxxxxxxxxxxxx'
        /> 
      </Container>
    </div>
  );
}

export default App;

Make sure to change CLIENT_ID and CLIENT_SECRET with the proper credentials obtained from IoTFlows console. These credentials can be either one of these options: 1. A Device Client that has permission to interact with the resources available in its project, or 2. An Organization IoT API KEY that can have read-only or read/write permissions to the entire organization resources 3. A User Client that is authorized to interact with the permitted resources of the user. This option is most useful when you need to build a web or mobile app. For this option, you need to register your Application in IoTFlows and authenticate users using OAuth2. With the obtained JWT, you can perform a Basic authentication HTTP request to generate a User Client.