MonetizationOS Docs

Environment Types

Environment types allow you to configure different categories of environments for your brands, enabling you to separate testing, staging, and production workflows based on your organizational requirements.

Environment types define how user data is segregated across your environments and brands. All environments of the same type can read and write data to the same data store, and conversely data cannot be shared between environments of different types.

By default, every organization includes Preview and Production environment types. You can create additional environment types such as Test, Staging, UAT, or any other categories that match your development and deployment workflow.

To begin, navigate to Settings in the left-hand navigation menu, then select the Environment Types tab.

Your environment types page shows a list of configured environment types and allows you to edit and delete existing types, or add new ones.

Create an Environment Type

To add an environment type, click 'Add Environment Type'.

You will be prompted to configure your environment type:

  • Name: Give your environment type a descriptive name
  • Description: Optional description of the environment type's purpose
  • Type: Set whether this environment is for testing or production use

Once configured, click 'Create Environment Type'. You will then be taken to the environment type management area.

Managing Environment Types

After creating an environment type, you can configure its settings and manage variables and secrets that apply to all environments of this type.

The management area includes two tabs: Variables & Secrets, and Manage.

Variables & Secrets

The Variables & Secrets tab allows you to define key-value pairs at the environment type level that can be consumed in workflows across all environments of this type, enabling you to separate configuration from logic.

Variables defined here will apply to all workflows running in environments of this type (e.g., all production environments, all staging environments) unless overridden by variables set at the brand-environment level.

Variables are useful for storing environment-type-specific configuration values like different API endpoints for production vs staging, environment-specific feature flags, or other settings that apply to this environment type. Secrets are a special type of variable designed for sensitive data like API keys, where the value cannot be viewed once saved.

Creating Variables & Secrets

To add a variable or secret, click 'Add Variable'.

You'll need to provide:

  • Key: The variable name (must start with a letter or underscore, contain only alphanumeric characters and underscores, maximum 64 characters)
  • Value: The variable content (stored as text)
  • Secret: Toggle this on to mark the variable as a secret

When you're ready to save, you can choose:

  • Save: Save the variable and return to the list
  • Save and Add Another: Save the variable and immediately create another one
  • Cancel: Discard changes and return to the list

Variable Precedence

Variables defined at the environment type level will override organization and brand-level variables with the same key, but will be overridden by variables set at the brand-environment level.

Using Variables in Workflows

Variables and secrets are accessible in workflows through the env parameter:

export default ({ env }) => {
  console.log(env.SERVICE_URL);

  // Use variables for configuration
  const apiEndpoint = env.API_ENDPOINT;
  const secretKey = env.SECRET_API_KEY;
};

All variables are provided as strings and may be undefined if not set at any level.

Security Considerations

Secrets are designed for sensitive data:

  • Values cannot be viewed in the console once saved
  • Values are not accessible via the admin API
  • Use secrets for API keys, passwords, and other sensitive configuration

Variables are for non-sensitive configuration:

  • Values are visible in the console
  • Use for API endpoints, feature flags, and other non-sensitive settings

Note: Ensure you use the secret toggle for any sensitive data like API keys or passwords.

Managing Variables & Secrets

To edit a variable or secret, locate it in your variables & secrets list, then click the 'Edit' icon in the actions column.

This will bring up the same screen you used to configure your variable. Make any relevant changes and click 'Save'.

To delete a variable or secret, locate it in your variables & secrets list, then click the 'Delete' icon in the actions column.

You will be prompted to confirm you wish to remove the variable. This action cannot be undone.

To continue, click 'Delete'. Otherwise, click 'Cancel'.

When updating a variable, the change will propagate to all relevant environments automatically.

Manage

The Manage tab allows you to edit the environment type's name and description, and view whether it's designated for testing or production use.

Make any relevant changes and click 'Update' to save your modifications.

Editing an Environment Type

To edit an environment type, locate it in your environment types list, then click the 'Edit' icon in the actions column.

This will bring up the environment type management area where you can modify the configuration or manage variables and secrets.

Deleting an Environment Type

To delete an environment type, locate it in your environment types list, then click the 'Delete' icon in the actions column.

You will be prompted to confirm you wish to remove the environment type. This action cannot be undone.

To continue, click 'Delete'. Otherwise, click 'Cancel'.

Warning: Deleting an environment type is a permanent action and cannot be undone. Ensure you no longer need this environment type before proceeding.