Settings methods

The settings SDK methods enable you to work with your UI App Settings. In a nutshell, settings are parameters your app exposes and users must set their value when they configure your UI App in their Gtmhub account. This enables you to dynamically consume user-specific settings in your app. For example, if your UI App requires an email address where notifications must be sent, you can expose an Email setting. Every time your UI app is added to a Gtmhub account, the Email setting will be available for users to fill in and you can then use the helper methods below to get its value and implement your email sending logic. All UI App settings are configured on the App Submission form on the Gtmhub marketplace. For more information about configuring App Settings, follow Build and publish an app.

NOTE: Before you start using the SDK methods, ensure you have imported and configured the SDK first.

getSetting

This helper method enables you to get a setting by its Id. The settingId for each setting is specified on the App Submissions form in the Gtmhub Marketplace. You can always refer to your submitted app to check what the Id of each setting you exposed is. For more information see Build and publish an app.

const settingId = "userEmail";
sdk
  .getSetting(settingId)
  .then((setting) => console.log(setting));

getSettings

This helper method get the collection of all app settings:

sdk
  .getSettings()
  .then((settings) => console.log(settings));