Apps Configurations

Prev Next

What is an App Configuration?

An App Configuration is a set of key-value pairs that an App can access at runtime. These settings dictate how your App behaves and connects to external services. For a Gladly customer, this means they can install an App (e.g. an order management system integration) once and have multiple configurations for different purposes—say, one for their US e-commerce site and another for their European retail stores.

Apps are configured using appcfg apps config command.

The App Platform provides these configuration values to your App's templates (e.g., for Actions or Data Pulls) through the .integration object. This object is structured into two main parts:

  1. integration.configuration – This part holds general, non-sensitive settings. Examples include:

    • API base URLs for an external service.

    • Region-specific settings.

    • Default values or feature flags.

  2. integration.secrets – This part is designed for sensitive data your App needs to authenticate with external systems or perform secure operations. Examples include:

    • API keys or access tokens.

    • Client secrets.

Gladly handles the secrets portion securely, ensuring they are not exposed inadvertently.

.integration

When the Gladly App Platform executes an action or data pull, it uses Go templates (.gtpl files) to dynamically construct the necessary HTTP request components: the URL, headers, and body. The data from configuration is available to templates throughout the App via .integration

An example configuration might look something like:

{
    "integration": {
        "configuration": {
          "shopName": "myPlantShop",
          "language": "eng"
        },
        "secrets": {
          "apiToken": "my-super-secret-token"
        }
    }
}

For example, an API that expects the shared secret to be specified in a X-API-Key header would have a corresponding X-API-Key.gtpl template file where the template would be something like the following:

{{.integration.secrets.apiKey}}