Environment configuration keys

The contract is src/environments/environment.interface.ts — 33 keys, the only tracked file in that folder. The generated environment*.ts files are `.gitignore`d.

Generation chain and the four-step process for adding a key: environments.

Backend base URLs

IEnvironment key Shell variable Dev value Production value

internalApiUrl

FRONTEND_INTERNAL_URL + FRONTEND_INTERNAL_API_URL

https://<env>.<domain>/database_v2/internal/

https://dbapi-internal.payability.com/bin/internal/

cliApiUrl

FRONTEND_INTERNAL_URL + /cli/

https://<env>.<domain>/database_v2/cli/

https://dbapi-internal.payability.com/bin/cli/

supWidgetsApiUrl

FRONTEND_INTERNAL_URL + /sup_widget/

https://<env>.<domain>/database_v2/sup_widget/

https://dbapi-internal.payability.com/bin/sup_widget/

authToolsApiUrl

FRONTEND_AUTH_TOOLS_API_URL

https://0vd7bg72e4.execute-api.us-east-1.amazonaws.com/stage/

https://api.payability.com/authtools/

actionsToolsUrl

FRONTEND_ACTION_TOOLS_API_URL

https://vn1s47jzkd.execute-api.us-east-1.amazonaws.com/stage/

https://api.payability.com/actionstools/

eventLoggerUrl

FRONTEND_EVENT_LOGGER_API_URL

https://epu44ua492.execute-api.us-east-1.amazonaws.com/test_rules2/

https://api.payability.com/eventlogger_v2/

eventRulesOldUrl

FRONTEND_EVENT_RULES_OLD_API_URL

https://drkrpkdxe4.execute-api.us-east-1.amazonaws.com/stage/

https://api.payability.com/eventlogger/

messagingUrl

FRONTEND_MESSAGING_API_URL

https://argumexh08.execute-api.us-east-1.amazonaws.com/stage/

https://api.payability.com/messaging/

workflowApiUrl

FRONTEND_TASK_MANAGER

https://<env>.<domain>/b2btaskmanager/

https://workflow.payability.com/b2btaskmanager/

b2bDocumentsApiUrl

FRONTEND_B2B_DOCUMENTS_API_URL

https://<env>.<domain>/b2bdocument/

https://doc-api.payability.com/b2bdocument/

pybDocumentsApiUrl

FRONTEND_PYB_DOCUMENTS_API_URL

https://<env>.<domain>/pyb-documents/

https://pyb-documents.payability.com/

documentsApiUrl

FRONTEND_DOCUMENTS_API_URL

https://ajwk785vec.execute-api.us-east-1.amazonaws.com/dev/

https://api.payability.com/documents/

s3FilesProviderApi

S3_FILES_PROVIDER_API

https://<env>.<domain>/s3-files-provider/

https://s3-files-provider.payability.com/

marketplaceApiUrl

MARKETPLACE_API

https://marketplace-api-dev2.payability.dev/

https://marketplace-api.payability.com/

automaticMarketplaceApiUrl

AUTOMATIC_UW_TOOL_API

https://<env>.<domain>/automatic-uw-tool-web-api/

https://automatic-uw-tool.payability.com/

evaApiUrl

EVA_API_CUSTOM_URL ?? EVA_API

https://<env>-eva-fe.<domain>/ (or http://localhost:4600/ locally)

https://prod-eva-fe.payability.com/

supplierUrl

FRONTEND_SUPPLIER_URL

https://<env>-supplier.<domain>;

https://supplier.payability.com

supplierReferralUrl

FRONTEND_REFERRAL_URL

https://go-test.payability.com/

https://goto.payability.com/

<env> is ENV_NAME, <domain> is the DOMAIN argument (dev.payability.com by default, payability.com for production).

Services hosted per environment interpolate <env>.<domain> and are therefore isolated. Lambda-backed services are fixed API Gateway URLs and are shared across every dev environment — actionsToolsUrl, authToolsApiUrl, eventLoggerUrl, eventRulesOldUrl, messagingUrl, documentsApiUrl, plus marketplaceApiUrl. A change made through one dev environment can be visible in another.

Which service uses which base URL: services and endpoints. What each backend does: the integration landscape.

Behaviour and identity

Key Source Notes

production

derived

true only when ENV_NAME=release.

envName

derived

'prod' when ENV_NAME=release, otherwise 'test' — including for staging. Read by themeConfigData, AppStageInfoComponent and showStoreDebugger.

VERSION

require('../../package.json').version

Evaluated in the browser, not baked in as a literal. Shown in the sidebar and on the login screen.

gitHash

git rev-parse HEAD

First 40 characters. AppStageInfoComponent shows the first 8 (when enabled).

lastBuildDate

new Date().toISOString().substr(0, 16)

ISO to the minute.

domain

DOMAIN argument

Used for the EVA cookie domain and iframe origin checks.

instanceId

hardcoded 8001

Sent as X-InstanceId / X-EventLogger-InstanceId by CrmService, GlobalSettingsService. EventsService hardcodes '8001' separately and MonitorService hardcodes 8003.

workflowGciId

FRONTEND_TASK_MANAGER_GCI

Dev: computed by deployment/generate_gci.py from ENV_NAME (first six digits of its SHA-1). Production: hardcoded 1.

Error display

Key Value Effect

displayErrorsInConsole

hardcoded true

AppErrorHandler logs errors in production. When false it prints "Check sentry logs or run in dev mode." instead.

displayErrorsPopup

hardcoded false

Read but never used — handleErrorProd ignores it.

Third-party keys

Key Source Notes

googleAuthClientId

hardcoded in set-env.ts

592848749680-3fs9ru3khk5u53i92hgf0v0giuhds1ee.apps.googleusercontent.com — the same client id for every environment. Only specific localhost ports are registered.

sentryUrl

hardcoded in set-env.ts

Identical in every environment. No Sentry SDK is installed and no code reads this. See observability.

frontendSegmentIOCode

FRONTEND_SEGMENTIO_CODE

Dev qQtIVnv1eERcK7bsQs8ITA48ak8kzxA3/, production J8O1DVU1ToteAHLWlfsqlD2uosWt5zhA/. set-env.ts appends the trailing / because it is concatenated straight into the CDN script URL.

Feature flags

Key Behaviour

featureFlags

process.env.FEATURE_FLAGS or ''. Neither .cfg template exports FEATURE_FLAGS, so build flags are empty unless the pipeline sets it. Flags are managed through the FEATURE_FLAGS_IA / FEATURE_FLAGS_EVA global settings instead — and global settings beat build flags.

Format: comma-separated, no spaces. An empty string disables all build flags. See feature flags and the flag catalogue.

Supplier sites

Key Value

supplierSiteVersions

A hardcoded array in set-env.ts: c2fo, morecommerce, neweggcapital, neweggcapital2, onboarding, onboarding1, supplier, supplier2, supplier3, supplier4, volusion.

These are the white-label self-service front ends. SupplierDetailsModel.supplierSite names which one a supplier uses. In test environments only supplier and supplier4 are valid login-as-supplier targets (messageCodes.inTestEnvironmentsCanOnlyTo).

A partly overlapping list drives the noindex meta tag in AppModule: volusion, pro, lendio, neweggcapital, morecommerce, crm2, c2fo.

Reading configuration

Always through AppConfigService:

constructor(private appConfig: AppConfigService) {
  this.apiUrl = appConfig.env.internalApiUrl;
}

Services that still import environment directly (legacy; do not extend): EventsService, EvaService, LookupRepository, PendingReviewService, FeatureFlagsService, GatewayService, MarketplaceRepository, VpnTesterService, CommunicationService, VersionService, FeatureFlagsGeneralGuard, storeDebugger, main.ts.

Adding a key — the four files

  1. src/environments/environment.interface.ts — add to IEnvironment.

  2. deployment/setup_template-dev.cfg — export the shell variable.

  3. deployment/setup_template-production.cfg — same.

  4. deployment/set-env.ts — add the field to the generated template literal.

Then ./deployment/setenv.sh <env> to regenerate locally.

Skipping step 2 or 3 gives you a working local value and undefined everywhere else. TypeScript will not catch it — the generated object satisfies the interface by simply omitting the property.

Dead configuration

Item Status

deployment/setup_template-legacy.cfg

Not sourced by setenv.sh. References test2-api.payability.com, workflow-test, b2btaskmanager2, GCI=12. Historical only.

sentryUrl

Configured, never read.

displayErrorsPopup

Read, never acted on.

Commented-out supplierApiUrl

Removed in SupplierService with a dated APPS-438 note.