Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

...

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.

...

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.

...

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

...

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.

...

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.

...

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);

...

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});

...

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.

...

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);
});