App Configuration

Once your app is developed and ready to launch, you need to provide settings for the Apps-Engine. The settings are displayed on the administration interface for the workspace admin to configure and launch the app.

Everything under the Settings menu of the app within a marketplace belongs under the app configuration. This tab contains various fields and instructions that can be filled out. What you see on the screen must be configured for the app. If you have a workspace, you can look at the Settings tab of existing apps on the Marketplace to see different app settings.

In this section, we will look at the configuration details.

Here are some key terms you need to familiarize yourself with:

  • ID - for identifying the settings.

  • Type - the type of value that will be saved.

  • Required - whether or not configuring the app is required.

  • Package value - the default value before the administrator can configure anything.

  • I18n label - the translated name or description of an app.

For more details, see the ISetting definition.

Additionally, here are some categories of configurations that Rocket.Chat supports. Each of these will appear differently within the Settings tab of the app in the marketplace.

  • Boolean

  • Code

  • Color

  • Font

  • Number

  • Select

  • String

  • Multi-select

You can create a distinct file containing the configuration settings, in which everything is defined as a basic object. In this file, define each setting separately. In the configurationExtend method, you simply read the file. For each setting, call the provideSetting method, so that each defined setting is read, called, and displayed in the user interface.

This is equivalent to executing the command:

configuration.settings.provideSetting ({

Since your app may have multiple settings, it is preferable to organize them all in a separate file and reference them as required in the app's main file.

Every time the administrator modifies the app's configuration via the Settings panel, the onSettingUpdated method is invoked each time. The method will use the new value to make adjustments as necessary. For instance, you can inform an external service that the parameters have changed and the values have been updated. With onPreSettingUpdate, you will receive both the old and updated settings values.

Consider the Jitsi app for Rocket.Chat. The settings.ts file contains the various app settings. These settings are called iteratively in the main app file with extendConfiguration. Here, the onSettingUpdated method is also used to update the app configurations.

Configure security protocols

It is common in integrations to transmit certain security protocols for API requests. In the case of the Rocket.Chat REST API, these headers are X-Auth-Token and X-User-Id. See the Authentication endpoints for more information. It would be desirable if these headers were always set when making API queries. In such situations, it is customary to generate a personal access token in Rocket.Chat and adding configuration parameters to the app makes sense. These are configured in the extendConfiguration method of the app's primary class.

The client ID and client secret are routinely generated by one of the mechanisms for the app settings. You can see this implemented in the settings file of the Notion app integration with Rocket.Chat.

Furthermore, along with defining the app configurations, you can create internationalization files for different languages. Let's look at the details in the next topic.

Last updated

Rocket.Chat versions receive support for six months after release.