Here is a list of the configuration options that the SDK constructor takes as parameters.
constructor (token: string, exhibitId: number, manifestLocation: string, options = {}) |
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.
The directory path to the JSON
file that defines the exhibit manifest.
All of the remaining optional parameters that enables certain features of the Gumband SDK.
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.
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 defined.
If the “endpoint” configuration option is set to “custom”, this option must also be set in order to tell the SDK the IP address of the Gumband server to which it is connecting.
The version of the Gumband Cloud to which the exhibit should connect. Set to “v1” by default.
Tells the SDK that the exhibit is expected to be disconnected from the internet, and should not attempt to authenticate with Gumband.
An array of hardware ID that should be connected to, even though there is no internet connection. These are Gumband Hardware that should be permitted to connect to the exhibit, even though they have not authenticated themselves with Gumband.
Whether a local MQTT broker (the GBTT service) should be started when the SDK is initialized. This MQTT broker is used to communicate with Gumband Hardware.
Only applicable if the “gbttEnabled” option is true
. This option is the port that the local MQTT broker is exposed on.
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.
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.
Use a local manifest to update the exhibit items on the gumband cloud. This function updates the SDK cache of the manifest as well.
The directory path to the manifest.
|
Get the current operating mode for the exhibit from Gumband.
|
Set the operating mode for the exhibit in Gumband.
The target operating mode.
|
Get the value of a status from Gumband.
The “id” field of the status in the manifest.
|
Set the value of a status in Gumband.
The “id” field of the status in the manifest.
The target value to which the status should be set.
|
Get the value of a setting from Gumband.
The “id” field of the setting in the manifest.
|
Set the value of a setting in Gumband.
The “id” field of the setting in the manifest.
The target value to which the setting should be set.
|
Get all settings as a map, where the key is the “id” field of each setting in the manifest.
|
Get all setting lists in the manifest as an array.
|
Get the list of Gumband Hardware that are currently connected to the SDK.
|
Get the full manifest of this exhibit from Gumband.
|
Get an exhibit setting with type StrapiContent
.
The database ID of the StrapiContent.
Set a hardware property to a value.
A string of the form {hardwareId}/{periph}/{prop}
, where hardwareId
is the ID of the hardware found under the Hardware/Auth tab in the Gumband UI, periph
is the name of the peripheral the property is within, and prop
is the name of the property that is having its value set.
The new value to which the property will be set.
|
Get all hardware associated with this exhibit in the Gumband UI.
|
Sends an MQTT message directly to the hardware with the given topic and rawPayload.
A string of the form {hardwareId}/{periph}/{prop}
, where hardwareId
is the ID of the hardware found under the Hardware/Auth tab in the Gumband UI, periph
is the name of the peripheral the property is within, and prop
is the name of the property that is having its value set.
The raw value to be parsed directly by the hardware.
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.
|
Get a list of all locally saved file names for the exhibit.
|
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.
|
Uploads a file to the list of remote files for the exhibit.
A stream of data from a function such as fs.createReadStream("path/to/file")
.
|
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.
The name of the file.
|
Creates a reporting event of the given event name, and includes the data object given as an object on the event.
The name of the reporting event.
Any data object to be associated with the event.
|
Logs a message to Gumband as an “info” level log. Logs can be viewed under the Exhibit/Logs tab in the Gumband UI.
The message for the log.
|
Logs a message to Gumband as an “debug” level log. Logs can be viewed under the Exhibit/Logs tab in the Gumband UI.
The message for the log.
|
Logs a message to Gumband as an “warn” level log. Logs can be viewed under the Exhibit/Logs tab in the Gumband UI.
The message for the log.
|
Logs a message to Gumband as an “error” level log. Logs can be viewed under the Exhibit/Logs tab in the Gumband UI.
The message for the log.
|
Creates an event within the bounds of a start and end interaction for a given exhibit
|
Ends an active interaction for a given exhibit.
|
Starts an active interaction for a given exhibit.
|
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.
The message for the custom email notification.
|
This is a list of the possible websocket events that may be emitted by the SDK; for example:
const { Sockets } = require("@deeplocal/gumband-node-sdk"); gumbandSDK.on(Sockets.CONTROL_RECEIVED, (payload) => { //code reached when the SDK emits a Sockets.CONTROL_RECEIVED event }); |
Emitted after the SDK successfully authenticates with Gumband, comes online, and is ready to make requests to Gumband.
|
Emitted when the SDK successfully authenticates with Gumband and comes online.
|
Emitted when the SDK losses its websocket connection with Gumband.
|
Emitted when a control is triggered, usually through the Exhibit/Controls tab in the Gumband UI.
|
Emitted when a setting is changed, usually through the Exhibit/Settings tab in the Gumband UI.
|
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 items.
|
Emitted when a setting list item is deleted. The payload is the setting list item that was deleted.
|
Emitted when the Operation Mode is changed, usually through the Exhibit dashboard in the Gumband UI.
|
Emitted when a Gumband Hardware associated with the exhibit connects to the exhibit.
|
Emitted when a Gumband Hardware associated with the exhibit disconnects from the exhibit.
|
Emitted when a property is changed in a Gumband Hardware that is connected to the exhibit.
|
Emitted when a new file has been uploaded to Gumband, usually through the Exhibit/Files tab of the Gumband UI.
|
Emitted when a file is deleted from Gumband, usually through the Exhibit/Files tab of the Gumband UI.
|