Skip to main content

Override configs

Definition​

This document describes how to override Pulse configurations via local storage and via the URL query parameter pa_env.


Configs in local storage​

Local storage overrides are applied at bootstrap time (before any module initializes). They are merged with the default config and the result is passed to all modules.

Key​

The local storage key must start with the storagePrefix config and end with config_override. By default, storagePrefix is paa_.

Example key: paa_config_override

Value​

The value must be a JSON string.

Example: {"pulseClientType":"test browser"}

Note: Configs must exist in local storage before Pulse is initialized.


Configs via URL query param (pa_env)​

The pa_env query parameter overrides the settings API base URL based on the environment. It is read during Settings module init from the current page URL.

Query param​

ParamDescription
pa_envEnvironment name. Accepted values: prod, stage

Effect on config​

When pa_env is present and valid, it sets config.settingsBaseURL to the corresponding base URL:

pa_env valuesettingsBaseURL set to
prodhttps://optifyr.com/web/v2
stagehttps://stage.optifyr.com/web/v2

Example URLs​

  • https://example.com/?pa_env=stage → settings requests go to https://stage.optifyr.com/web/v2
  • https://example.com/?pa_env=prod → settings requests go to https://optifyr.com/web/v2
  • https://example.com/ (no param) → default settingsBaseURL from config is used

Note: Only prod and stage are supported. Any other value is ignored and the default or local-storage-overridden settingsBaseURL is used.


Precedence​

  1. Default config — base values.
  2. Local storage ({storagePrefix}config_override) — merged at bootstrap; result is the effective config for all modules.
  3. Query param (pa_env) — applied during Settings module init and overrides only settingsBaseURL for that module.

So for settingsBaseURL, the order is: default → local storage override → pa_env (if present and valid).