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
| Param | Description |
|---|---|
pa_env | Environment 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 value | settingsBaseURL set to |
|---|---|
prod | https://optifyr.com/web/v2 |
stage | https://stage.optifyr.com/web/v2 |
Example URLs
https://example.com/?pa_env=stage→ settings requests go tohttps://stage.optifyr.com/web/v2https://example.com/?pa_env=prod→ settings requests go tohttps://optifyr.com/web/v2https://example.com/(no param) → defaultsettingsBaseURLfrom 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
- Default config — base values.
- Local storage (
{storagePrefix}config_override) — merged at bootstrap; result is the effective config for all modules. - Query param (
pa_env) — applied during Settings module init and overrides onlysettingsBaseURLfor that module.
So for settingsBaseURL, the order is: default → local storage override → pa_env (if present and valid).