Metadata

Metadata Class Reference
Metadata API Reference

Metadata is a per-obniz setting that can be configured by the user on the obniz cloud.
Metadata is loaded when connecting to the cloud and can be read from the metadata property.

Metadata is loaded when connecting to the cloud and can be read from the metadata property. It can be used to read information such as the description of the device and the API key, which can be used to make each device work differently.

The properties can be read after the connection is completed. Also, all data is of string type.
Any metadata changed on the Cloud will be updated the next time you connect.

// Javascript Full Example

var obniz = new Obniz("OBNIZ_ID_HERE");
obniz.onconnect = async function () {
  console.log(obniz.metadata.description);

  if (obniz.metadata.mode === 'debug') {
    obniz.io0.output(true);
    console.log(`debug mode`);
  }
}