Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel2
outlinefalse
typelist
printablefalse

SDK Configuration Options

Here is a list of the configuration options that the SDK constructor takes as parameters.

Code Block
languagejs
constructor (token: string, exhibitId: number, manifestLocationmanifest: stringObject, options = {})

token

The exhibit token generated through the Exhibit/Auth tab in the Gumband UI. This is required to authenticate the SDK with Gumband.

exhibitId

The ID of the exhibit in Gumband. This can be found under the Exhibit/Auth tab in the Gumband UI. This is required to authenticate the SDK with Gumband.

...

manifest

The directory path to the JSON file that defines the exhibit manifestexhibit manifest. See the Exhibit Manifest Configuration docs for how to structure the manifest object.

options

All of the remaining optional parameters that enables certain features of the Gumband SDK.

contentLocation: string

Including this option tells the SDK to download a copy of each file in the Exhibit/Files tab of the Gumband UI and save them in this location. The SDK will automatically sync these files each time it starts and connects to Gumband, but the files can also be synced manually with the gb.content.sync() function.

endpoint: string

Set to “app” by default. May be set to “custom” if app.gumband.com is not the instance of Gumband to which you’re connecting your exhibit. If set to “custom”, the “customServerIP” option must also be definedsdk can connect the “customServerIP” option or 0.0.0.0 if “customServerIP“ is left undefined.

customServerIP: string

If the “endpoint” configuration option is set to “custom”, this option must also can be set in order to tell the SDK the IP address of the Gumband server to which it is connecting. Set to 0.0.0.0 by default.

version: string

The version of the Gumband Cloud to which the exhibit should connect. Set to “v1” by default.

noInternetConnection: boolean

Tells the SDK that the exhibit is expected to be disconnected from the internet, and should not attempt to authenticate with Gumband.

...

An IP for the user provided MQTT broker. The SDK will attempt to open an MQTT client connection to this IP and the port from the MQTTBrokerPort option.

MQTTBrokerPort: number

Only applicable if the “gbttEnabled” option is true. This option is the port that the local MQTT broker is exposed on, or the port that the SDK should attempt to connect to if running a third part MQTT broker.

skipOrganizationFileSync: boolean

Set to true by default. Tells the SDK not to download all organization files along with the exhibit files when the “contentLocation” option is provided. Exhibit files are only accessible by the exhibit under the Exhibit/Files tab in the Gumband UI, but organization files are available to all exhibits under the organization and can be seen under each exhibits' Files tab. Organization files are prefixed by “[ORG]” and are managed by the Strapi CMS.

SDK Base Function Library

isReady( )

Returns true if Gumband is connected to the Gumband Cloud and is ready to process requests. Useful when the Gumband SDK is initialized in multiple places since the constructor returns a singleton and it is possible to "miss" the READY event if an event listener is not configured yet.

setManifest(manifestLocation: string): Promise<void>

Use a local manifest to update the exhibit items on the gumband cloud. This function updates the SDK cache of the manifest as well.

manifestLocation

The directory path to the manifest.

Expand
titleExample
Code Block
languagejs
gumbandSDK.setManifest('./path/to/manifest.json');

getOperatingMode( ): Promise<boolean>

...

Note

The Operating Mode feature is deprecated and disabled by default. You can continue to use it, but we plan to replace it with a more functional feature in the future. When the feature is disabled, this method will always resolve false. To enable the OperatingMode feature, call the setOperatingMode method once while the SDK is connected to the Gumband platform.

Get the current operating mode for the exhibit from Gumband.

Expand
titleExample
Code Block
languagejs
let operatingMode = await gumbandSDK.getOperatingMode();

console.log(`Operating Mode: ${operatingMode}`);
// Operating Mode: true

setOperatingMode(opMode: boolean): Promise<void>

Set the operating mode for the exhibit in Gumband.

opMode

The target operating mode.

Expand
Note

The Operating Mode feature is deprecated and disabled by default. You can continue to use it, but we plan to replace it with a more functional feature in the future. To enable the OperatingMode feature, call the setOperatingMode method once while the SDK is connected to the Gumband platform.

Set the operating mode for the exhibit in Gumband.

opMode

The target operating mode.

Expand
titleExample
Code Block
languagejs
await gumbandSDK.setOperatingMode(true);

getStatus(statusName: string): Promise<string>

Get the value of a status from Gumband.

statusName

The “id” field of the status in the manifest.

Expand
titleExample
Code Block
languagejs
let statusValue = await gumbandSDK.getStatus('cpu-usage');

console.log(`CPU Usage: ${statusValue}`);
// CPU Usage: 50%

setStatus(statusName: string, value: string): Promise<void>

Set the value of a status in Gumband.

statusName

The “id” field of the status in the manifest.

value

The target value to which the status should be set.

Expand
titleExample
Code Block
languagejs
await gumbandSDK.setStatus('cpu-usage', "50%");

getSetting(manifestId: string): Promise<string>

Get the value of a setting from Gumband.

manifestId

The “id” field of the setting in the manifest.

Expand
titleExample
Code Block
languagejs
let motorRPM = await gumbandSDK.getSetting('motor-rpm');

console.log(`Motor RPM: ${motorRPM}`);
// Motor RPM: 30

setSetting(settingName: string, value: string): Promise<void>

Set the value of a setting in Gumband.

settingName

The “id” field of the setting in the manifest.

value

The target value to which the setting should be set.

Expand
titleExample
Code Block
languagejs
await gumbandSDK.setSetting('motor-rpm', '30');

getAllSettings( ): Promise<Map<Setting>>

Get all settings as a map, where the key is the “id” field of each setting in the manifest.

Expand
titleExample
Code Block
languagejs
console.log(await gumbandSDK.getAllSettings());

//{
//  'motor-rpm': {
//    id: 14,
//    manifestId: 'motor-rpm',
//    exhibitId: 1,
//    type: 'IntegerInput',
//    display: 'Motor RPM',
//    enabledOpMode: null,
//    value: 30,
//    default: 0,
//    order: 0,
//    touchless: null,
//    listId: null,
//    groupId: null,
//    read: true,
//    write: true
//  }
//}

getAllSettingLists( ): Promise<SettingList[ ]>

Get all setting lists in the manifest as an array.

Expand
titleExample
Code Block
languagejs
console.log(await gumbandSDK.getAllSettingLists());

//[
//  {
//    id: 1,
//    exhibitId: 1,
//    manifestId: 'my-list',
//    listDisplay: 'List Label',
//    listParent: null,
//    schema: [ [Object], [Object] ],
//    listItemCount: 1,
//    order: [ 'item 1' ],
//    orderSelf: null,
//    groupId: null,
//    settinglistitems: [ [Object] ],
//    type: 'SettingsList'
//  }
//]

getOnlineHardware( ): Hardware[ ]

Get the list of Gumband Hardware that are currently connected to the SDK.

Expand
titleExample
Code Block
languagejs
console.log(gumbandSDK.getOnlineHardware());

//[
//  {
//    hardwareId: 83,
//    name: 'Gumband SDK Tutorial',
//    peripherals: { Button: [Object], LED: [Object] }
//  }
//]

Exhibit

exhibit.getManifest( ): Promise<Manifest>

Get the full manifest of this exhibit from Gumband.

Expand
titleExample
Code Block
languagejs
console.log(await gumbandSDK.exhibit.getManifest());

//{
//  manifest: {
//    id: 249,
//    siteId: 34,
//    name: 'Gumband SDK Tutorial',
//    mqttPath: '',
//    online: true,
//    manifestLocked: false,
//    opMode: 'On',
//    settingLists: [],
//    settingGroups: [ [Object], [Object] ],
//    settings: [ [Object] ],
//    statuses: [ [Object], [Object], [Object] ],
//    controls: [ [Object], [Object] ],
//    strapiContent: []
//  }
//}

exhibit.getStrapiContentSetting(id: number): Promise<StrapiContent>

Get an exhibit setting with type StrapiContent.

id

The database ID of the StrapiContent.

Hardware

hardware.setProperty(id: string, topic: string, value: any, options: any): Promise<void>

Set a hardware property to a value.

id

A string of the form ed028e04-41d9-4e77-a5d2-ab4e7346e3a7. This is the hardware ID.

topic

A string of the form property/path, which is the name and path to the property that is having its value set.

value

The new value to which the property will be set.

[options.source]

The source of the property. Can be either “system”, which come on the Gumband Hardware by default, or “app”, which are created in the user firmware. This value will be set to “app” by default.

Expand
titleExample
Code Block
languagejs
//gmbnd_bool property type
await gumbandSDK.hardware.setProperty("ed028e04-41d9-4e77-a5d2-ab4e7346e3a7", "My Property", 1);

hardware.getProperty(id: string, topic: string): Promise<any>

Get the value of the given property.

id

A string of the form ed028e04-41d9-4e77-a5d2-ab4e7346e3a7. This is the hardware ID.

topic

A string of the form property/path, which is the name and path to the property that is having its value set.

[options.source]

The source of the property. Can be either “system”, which come on the Gumband Hardware by default, or “app”, which are created in the user firmware. This value will be set to “app” by default.

Expand
titleExample
Code Block
languagejs
//gmbnd_bool property type
console.log(await gumbandSDK.hardware.getProperty("ed028e04-41d9-4e77-a5d2-ab4e7346e3a7", "My Property"));

// 1

hardware.getRegisteredProperties(id: string): Promise<Property[ ]>

Get all registered properties for a hardware. Will not include values for those properties

id

A string of the form ed028e04-41d9-4e77-a5d2-ab4e7346e3a7. This is the hardware ID.

[options.source]

The source of the property. Can be either “system”, which come on the Gumband Hardware by default, or “app”, which are created in the user firmware. This value will be set to “app” by default.

Expand
titleExample
Code Block
languagejs
//gmbnd_bool property type
console.log(await gumbandSDK.hardware.getRegisteredProperties("ed028e04-41d9-4e77-a5d2-ab4e7346e3a7"));

// [{
//    path: 'Types/My Bool',
//    desc: '',
//    index: 1,
//    type: 'gmbnd_primitive',
//    format: '!?',
//    length: 1,
//    settable: true,
//    gettable: true,
//    ui_hidden: false
//  }]

hardware.reboot(id: string): Promise<void>

Triggers a reboot of the hardware matching the given ID.

id

A string of the form ed028e04-41d9-4e77-a5d2-ab4e7346e3a7. This is the hardware ID.

Expand
titleExample
Code Block
languagejs
await gumbandSDK.hardware.reboot("ed028e04-41d9-4e77-a5d2-ab4e7346e3a7");

hardware.identify(id: string): Promise<void>

Triggers the hardware matching the given ID to identify itself by flashing its LED.

id

A string of the form ed028e04-41d9-4e77-a5d2-ab4e7346e3a7. This is the hardware ID.

Expand
titleExample
Code Block
languagejs
await gumbandSDK.hardware.identify("ed028e04-41d9-4e77-a5d2-ab4e7346e3a7");

hardware.getExhibitHardware( ): Promise<Response<Hardware[ ]>>

Get all hardware associated with this exhibit in the Gumband UI.

Expand
titleExample
Code Block
languagejs
console.log(await gumbandSDK.hardware.getExhibitHardware());

//[
//    {
//      id: '782ff2c2-11ef-489f-aa79-d0c229cd4799',
//      exhibitApi: 'v1',
//      exhibitId: 407,
//      name: 'My Hardware',
//      type: 'custom-hardware',
//      connected: false,
//      connectedChangedAt: null,
//      category: 'hardware'
//    }
//]

hardware.sendMqttMessage(topic: string, rawPayload): Promise<void>

Sends an MQTT message directly to the hardware with the given topic and rawPayload.

topic

A string of the form {hardwareId}/{prop}, where hardwareId is the ID of the hardware found under the Hardware/Auth tab in the Gumband UI, and prop is the name of the property that is having its value set.

rawPayload

The raw value to be sent directly by the hardware.

hardware.getAllRegisteredHardware(): Promise<Map<Hardware>>

Gets a map of all registered hardware keyed by the hardware id.

Expand
titleExample
Code Block
languagejs
console.log(await gumbandSDK.hardware.getAllRegisteredHardware());

//[
//  {
//    id: "ed028e04-41d9-4e77-a5d2-ab4e7346e3a7",
//    system: {
//      info: {
//        ...systemInfo
//      },
//      properties: {
//        ...systemProperties
//      }
//    },
//    app: {
//      info: {
//        ...appInfo
//      },
//      properties: {
//        ...appProperties
//      }
//    }
//  }
//]

hardware.getRegisteredHardware(id: string): Promise<Hardware>

Gets a hardware that is registered.

id

A string of the form ed028e04-41d9-4e77-a5d2-ab4e7346e3a7. This is the hardware ID.

Expand
titleExample
Code Block
languagejs
console.log(await gumbandSDK.hardware.getRegisteredHardware("ed028e04-41d9-4e77-a5d2-ab4e7346e3a7"));

//  {
//    id: "ed028e04-41d9-4e77-a5d2-ab4e7346e3a7",
//    system: {
//      info: {
//        ...systemInfo
//      },
//      properties: {
//        ...systemProperties
//      }
//    },
//    app: {
//      info: {
//        ...appInfo
//      },
//      properties: {
//        ...appProperties
//      }
//    }
//  }

hardware.getIdFromName(name: string): Promise<string>

Gets a hardware id from the given name.

name

The name of the hardware that the user gave it in the Gumband UI.

Expand
titleExample
Code Block
languagejs
console.log(await gumbandSDK.hardware.getRegisteredHardware("My Hardware"));

// "ed028e04-41d9-4e77-a5d2-ab4e7346e3a7"

Content

content.getRemoteFileList( ): Promise<Response<File[ ]>

Get a list of all remote file names. These file names will match the files list under the Exhibit/Files tab in the Gumband UI.

Expand
titleExample
Code Block
languagejs
let remoteFiles = await gumbandSDK.content.getRemoteFileList();

console.log(remoteFiles);
//{
//  response: 'OK',
//  files: [
//    {
//      file: 'gumband-cassette.png',
//      name: 'gumband-cassette.png',
//      hash: 'SlTZJxaq+s5YH4R1KX6wHA==',
//      lastUpdated: '2023-08-14T19:22:08.547Z',
//      size: '81204'
//    }
//  ],
//  errors: []
//}

content.getLocalFileList( ): File[ ]

Get a list of all locally saved file names for the exhibit.

Expand
titleExample
Code Block
languagejs
let localFiles = gumbandSDK.content.getLocalFileList();

console.log(localFiles);
//{
//  files: [
//    {
//      file: 'gumband-cassette.png',
//      name: 'gumband-cassette.png',
//      hash: 'SlTZJxaq+s5YH4R1KX6wHA==',
//      lastUpdated: '2023-08-14T19:22:08.547Z',
//      size: '81204'
//    }
//  ]
//}

content.sync( ): Promise<void>

Sync locally saved files with the list of remote files. This is called whenever the SDK makes a connection to Gumband if local files is enabled.

Expand
titleExample
Code Block
languagejs
await gumbandSDK.content.sync();

content.uploadFile(fileStream: ReadStream): Promise<void>

Uploads a file to the list of remote files for the exhibit.

fileStream

A stream of data from a function such as fs.createReadStream("path/to/file").

Expand
titleExample
Code Block
languagejs
const fileStream = fs.createReadStream("path/to/file");
await gumbandSDK.content.uploadFile(fileStream);

content.downloadFile(file: string): Promise<void>

Downloads the given file name from the remote list of files for the exhibit in Gumband, and saves it in the contentLocation directory for the locally saved exhibit files. Existing files with the same name will be overwritten.

file

The name of the file.

Expand
titleExample
Code Block
languagejs
await gumbandSDK.content.downloadFile("gumband-cassette.png");

Event

event.create(eventName: string, data: any): Promise<void>

Creates a reporting event of the given event name, and includes the data object given as an object on the event.

eventName

The name of the reporting event.

data

Any data object to be associated with the event.

Expand
titleExample
Code Block
languagejs
await gumbandSDK.event.create("Red Button Pressed", { holdTime: 2.52 });

Logger

logger.info(message: string): Promise<void>

Logs a message to Gumband as an “info” level log. Logs can be viewed under the Exhibit/Logs tab in the Gumband UI.

message

The message for the log.

Expand
titleExample
Code Block
languagejs
await gumbandSDK.logger.info("This is an info log message");

logger.debug(message: string): Promise<void>

Logs a message to Gumband as an “debug” level log. Logs can be viewed under the Exhibit/Logs tab in the Gumband UI.

message

The message for the log.

Expand
titleExample
Code Block
languagejs
await gumbandSDK.logger.debug("This is a debug log message");

logger.warn(message: string): Promise<void>

Logs a message to Gumband as an “warn” level log. Logs can be viewed under the Exhibit/Logs tab in the Gumband UI.

message

The message for the log.

Expand
titleExample
Code Block
languagejs
await gumbandSDK.logger.warn("This is a warning log message");

logger.error(message: string): Promise<void>

Logs a message to Gumband as an “error” level log. Logs can be viewed under the Exhibit/Logs tab in the Gumband UI.

message

The message for the log.

Expand
titleExample
Code Block
languagejs
await gumbandSDK.logger.error("This is an error log message");

Metrics

metrics.broadcastEventConfigs(manifest: object)

Sends metrics configurations from the manifest to the gumband cloud

Expand
titleExample
Code Block
gumbandSDK.metrics.broadcastEventConfigs(manifest);

metrics.create(eventName: string, data: object)

Creates an event within the bounds of a start and end interaction a metrics event for a given exhibit

Expand
titleExample
Code Block
gumbandSDK.metrics.create('Use_Pressed_Button_1', { buttonType: 'accept', score: 72, isGameOver: false});

metrics.endInteraction(data?: object)

Ends an active interaction for a given exhibit.

Expand
titleExample
Code Block
gumbandSDK.metrics.endInteraction()

metrics.startInteraction(data?: object)

Starts an active interaction for a given exhibit.

Expand
titleExample
Code Block
gumbandSDK.metrics.startInteraction()

Notification

...

metrics.

...

createConcurrent(eventName: string, data: object, interactionId?: string):

...

string

This method is identical to the create method except that it attaches an interactionId to each event, so Gumband can tell the difference between events for different, concurrent interactions. It will return the generated interactionId so it can be attached to future events for this interaction.

Expand
titleExample
Code Block
gumbandSDK.metrics.createConcurrent('Use_Pressed_Button_1', { buttonType: 'accept', score: 72, isGameOver: false}, interactionId);

metrics.startConcurrentInteraction(data: object, interactionId?: string): string

This method is identical to the startInteraction method except that it generates and attaches an interactionId to each event, so Gumband can tell the difference between events for different, concurrent interactions. It will return the generated interactionId so it can be attached to future events for this interaction.

Expand
titleExample
Code Block
gumbandSDK.metrics.startConcurrentInteraction({}, interactionId);

metrics.endConcurrentInteraction(data: object, interactionId: string): string

This method is identical to the endInteraction method except that it attaches an interactionId to each event, so Gumband can tell the difference between events for different, concurrent interactions.

Expand
titleExample
Code Block
gumbandSDK.metrics.startConcurrentInteraction({}, interactionId);

Notification

notifications.email(message: string): Promise<void>

Sends a custom email notification through Gumband. Custom email notifications can be subscribed to on an individual user basis under the Exhibit/Notifications tab of the Gumband UI.

message

The message for the custom email notification.

Expand
titleExample
Code Block
languagejs
await gumbandSDK.notification.email("Your exhibit requires maintenance");

Websocket Events

This is a list of the possible websocket events that may be emitted by the SDK; for example:

Code Block
languagejs
const { Sockets } = require("@deeplocal/gumband-node-sdk");

gumbandSDK.on(Sockets.CONTROL_RECEIVED, (payload) => {
  //code reached when the SDK emits a Sockets.CONTROL_RECEIVED event
});

Sockets.READY

Emitted after the SDK successfully authenticates with Gumband, comes online, and is ready to make requests to Gumband.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.READY, (manifest) => {
    console.log(manifest);
    
    // {
    //     id: 1,
    //     siteId: 1,
    //     name: 'E',
    //     mqttPath: null,
    //     online: true,
    //     manifestLocked: false,
    //     opMode: 'Off',
    //     settingLists: [...],
    //     settingGroups: [...],
    //     settings: [...],
    //     statuses: [...],
    //     controls: [...],
    //     strapiContent: [...]
    // }
});

Sockets.EXHIBIT_ONLINE

Emitted when the SDK successfully authenticates with Gumband and comes online.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.EXHIBIT_ONLINE, () => {
    //no payload for the the Sockets.EXHIBIT_ONLINE event.
});

Sockets.EXHIBIT_OFFLINE

Emitted when the SDK losses its websocket connection with Gumband.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.EXHIBIT_OFFLINE, () => {
    //no payload for the the Sockets.EXHIBIT_OFFLINE event.
});

Sockets.CONTROL_RECEIVED

Emitted when the SDK losses its websocket connection with Gumbanda control is triggered, usually through the Exhibit/Controls tab in the Gumband UI.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.EXHIBITCONTROL_OFFLINERECEIVED, async (payload) => { {
    console.log(payload);

    // {
    //   id: 'control_manifest_id',
    //   touchless: undefined,
    //   sessionId: undefined,
    //no payload for the the Sockets.EXHIBIT_OFFLINE event.   sessionUser: undefined
    // }
});

Sockets.

...

SETTING_RECEIVED

Emitted when a control setting is triggeredchanged, usually through the Exhibit/Controls Settings tab in the Gumband UI.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.CONTROLSETTING_RECEIVED, async (payload) => {
    console.log(payload);
    
    // {
    //     id: 'controlsetting_manifest_id',
    //     value: 'new value',
    //     touchless: undefined,
    //     sessionId: undefined,
    //     sessionUser: undefined
    // }
});

Sockets.SETTING_LIST_RECEIVED

Emitted when a new setting list item is added or deleted, when the setting list items have their order changed, or when a setting within a setting list item is changed, usually through the Exhibit/Settings tab in the Gumband UI. The payload is the new setting list with all of its items.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.SETTING_LIST_RECEIVED, (payload) => {
    console.log(payload);
    
    // { 
    //     id: 'setting_list_manifest_id', 
    //     value: 'new value',[
    //     touchless: undefined,     //...settingListItems
     sessionId: undefined,
    //     sessionUser:]
undefined     // }
});

Sockets.SETTING_LIST_ITEM_

...

DELETED

Emitted when a new setting list item is added or deleted, when the setting list items have their order changed, or when a setting within a setting list item is changed. The payload is the new setting list with all of its itemsitem that was deleted.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.SETTING_LIST_RECEIVEDITEM_DELETED, (payload) => {
    console.log(payload);
    
    // {
    //   "id": "list_manifest_id",
    //   "value": [
    //     {
    //       "id": "deleted_list_item_name",
    // {      //     id: 'setting_list_manifest_id',"value": [ ...listItemValues ]
     //     value:}
[     //   ]
      ...settingListItems
    //     ]
    // }
});

Sockets.SETTING_LIST_ITEM_DELETED

...

// }
});

Sockets.OP_MODE_RECEIVED

Note

The Operating Mode feature is deprecated and disabled by default. You can continue to use it, but we plan to replace it with a more functional feature in the future. While the feature is disabled, this event will not be emit to your software. To enable the OperatingMode feature, call the setOperatingMode method once while the SDK is connected to the Gumband platform.

Emitted when the Operation Mode is changed, usually through the Exhibit dashboard in the Gumband UI.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.SETTINGOP_LISTMODE_ITEM_DELETEDRECEIVED, (payload) => {
    console.log(payload);
    
    // {
    //   "id": "list_manifest_id",
    //   "value": [true
    //     {
    //       "id": "deleted_list_item_name",
    //       "value": [ ...listItemValues ]}
});

Sockets.HARDWARE_CONNECTED

Emitted when a Gumband Hardware connects to the exhibit SDK.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.HARDWARE_CONNECTED, (payload) => {
    console.log(payload);
    
    // {
   }     //    ]id: "hardware-id"
    // }
});

Sockets.

...

HARDWARE_

...

DISCONNECTED

Emitted when the Operation Mode is changed, usually through the Exhibit dashboard in the Gumband UIa Gumband Hardware disconnects from the exhibit SDK.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.OPHARDWARE_MODE_RECEIVEDDISCONNECTED, (payload) => {
    console.log(payload);
    
    // {
    //   valueid: true"hardware-id,
    // }
});

Sockets.HARDWARE_SYSTEM_

...

REGISTERED

Emitted when after a Gumband Hardware connects to Hardware connects to and registers its system info/properties with the exhibit SDK.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.HARDWARE_CONNECTEDSYSTEM_REGISTERED, (payload) => {
    console.log(payload);
    
    //  {
    //    id: "hardware-id",
    //    system: {
    //  }
});

Sockets.HARDWARE_DISCONNECTED

Emitted when a Gumband Hardware disconnects from the exhibit SDK.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.HARDWARE_DISCONNECTED, (payload) => {    info: {
    //        console.log(payload);...systemInfo
    //     // {},
    //      idproperties: "hardware-id,{
    // } });

Sockets.HARDWARE_SYSTEM_REGISTERED

Emitted after a Gumband Hardware connects to and registers its system info/properties with the exhibit SDK.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.HARDWARE_SYSTEM_REGISTERED, (payload) => {     console.log(payload);...systemProperties
    
//    //  {}
    //    id: "hardware-id"},
    //    systemapp: {
    //      info: {
    //        ...systemInfoappInfo
    //      },
    //      properties: {
    //        ...systemPropertiesappProperties
    //      }
    //    },
    //    app: {
    //      info: {
    //}
});

Sockets.HARDWARE_APP_REGISTERED

Emitted when a Gumband Hardware connects to and registers its app info/properties with the exhibit SDK.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.HARDWARE_APP_REGISTERED, (payload) => {
    console.log(payload);
    
    //  ...appInfo{
    //      }id: "hardware-id",
    //      propertiessystem: {
    //        ...appPropertiesinfo: {
    //      }  ...systemInfo
    //    }     //  }
});

Sockets.HARDWARE_APP_REGISTERED

Emitted when a Gumband Hardware connects to and registers its app info/properties with the exhibit SDK.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.HARDWARE_APP_REGISTERED, (payload) => {,
    //      properties: {
    //       console.log(payload); ...systemProperties
    //      }
    //   { },
    //    idapp: "hardware-id",{
    //    system  info: {
    //        ...appInfo
    //      },
    //      infoproperties: {
    //        ...systemInfoappProperties
    //      },
    //    }
 properties: {  //  }
//   });

Sockets.HARDWARE_FULLY_REGISTERED

Emitted when a Gumband Hardware connects to and registers its app and system info/properties with the exhibit SDK.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.HARDWARE_FULLY_REGISTERED, (payload) => {
    ...systemPropertiesconsole.log(payload);
    
//    //  }{
    //      }id: "hardware-id",
    //    appsystem: {
    //      info: {
    //        ...appInfosystemInfo
    //      },
    //      properties: {
    //        ...appPropertiessystemProperties
    //      }
    //    },
    //  }
});

Sockets.HARDWARE_FULLY_REGISTERED

Emitted when a Gumband Hardware connects to and registers its app and system info/properties with the exhibit SDK.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.HARDWARE_FULLY_REGISTERED, (payload) => {
    console.log(payload);  app: {
    //      info: {
    //  {        ...appInfo
    //    id: "hardware-id"  },
    //    system  properties: {
    //      info: {  ...appProperties
    //      }
    ...systemInfo//    }
    //      },
    //  }
});

Sockets.HARDWARE_SYSTEM_PROPERTY_RECEIVED

Emitted when a system property is changed in a Gumband Hardware that is connected to the exhibit.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.HARDWARE_SYSTEM_PROPERTY_RECEIVED, async (payload) => {
    console.log(payload);
   properties: {
    //   {
    ...systemProperties
    //       }id: 'hardware-id',
    //    },     //    appinfo: {
    //      info  system: { info: [Object], properties:  //[Array] },
    //   ...appInfo     //app: { info: [Object], properties: [Array] },
    //      properties:},
{     //      value: [  ...appProperties"myValue" ],
    //      property: 'My }Property',
    //    }  source: 'app'
    //  }
});

Sockets.HARDWARE_

...

APP_PROPERTY_RECEIVED

Emitted when a system an app property is changed in a Gumband Hardware that is connected to the exhibit.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.HARDWARE_SYSTEMAPP_PROPERTY_RECEIVED, async (payload) => {
    console.log(payload);
    
    //  {
    //      id: 'hardware-id',
    //      info: {
    //        system: { info: [Object], properties: [Array] },
    //        app: { info: [Object], properties: [Array] }
    //      },
    //      value: [ "myValue" ],
    //      property: 'My Property',
    //      source: 'app'
    //  }
});

Sockets.HARDWARE

...

_PROPERTY_RECEIVED

Emitted when an either a system or app property is changed in a Gumband Hardware that is connected to the exhibit.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.HARDWARE_APP_PROPERTY_RECEIVED, async (payload) => {
    console.log(payload);
    
    //  {
    //      id: 'hardware-id',
    //      info: {
    //        system: { info: [Object], properties: [Array] },
    //        app: { info: [Object], properties: [Array] }
    //      },     //   app: {  valueinfo: [ "myValue" ],Object], properties: [Array] }
    //      property: 'My Property'},
    //      source: 'app'
    //  }
});

Sockets.HARDWARE_PROPERTY_RECEIVED

Emitted when either a system or app property is changed in a Gumband Hardware that is connected to the exhibit.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.HARDWARE_PROPERTY_RECEIVED, async (payload) => {
    console.log(payload);
    value: [ "myValue" ],
    //      property: 'My Property',
    //  {     //source: 'app'
    //   id: 'hardware-id',
    //      info: }
});

Sockets.FILE_UPLOADED

Emitted when a new file has been uploaded to Gumband, usually through the Exhibit/Files tab of the Gumband UI.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.FILE_UPLOADED, (payload) => {
    //  console.log(payload);
    
system: { info: [Object], properties: [Array] },
    //        app: {
info: [Object], properties: [Array] }
    //      }file: 'uploadedFileName.png',
    //      valuesize: [ "myValue" ]7891,
    //      propertyexhibitId: 'My Property1',
    //      sourcelastUpdated: 'app2023-08-28T16:14:54.418Z'
    //  }
});

Sockets.FILE_

...

DELETED

Emitted when a new file has been uploaded to file is deleted from Gumband, usually through the Exhibit/Files tab of the Gumband UI.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.FILE_UPLOADEDDELETED, (payload) => {
    console.log(payload);
    
    // {
    //   file: 'uploadedFileName.png',
    //   size: 7891,
    //   exhibitId: '1', { 
    //   lastUpdatedfile: '2023-08-28T16:14:54.418ZdeletedFileName.png'
    // }
});

Sockets.

...

ERROR

Emitted when a file is deleted from Gumband, usually through the Exhibit/Files tab of the Gumband UIany error is logged to the local logger via Gumband.

Expand
titleExample
Code Block
languagejs
gumbandSDK.on(Sockets.FILE_DELETEDERROR, (payload) => {
    console.log(payload);
    
    // {  This is an error message
    // Note:  file: 'deletedFileName.png'you can forward these errors to the Gumband UI by calling:
    // }gumbandSDK.logger.error(payload);
});