Skip to content

[Feature request] Support config profiles variable in local.json #1579

@luxferre

Description

@luxferre

Description:
Currently, local.json does not support referencing different HubSpot CLI config profiles' variables. Variables defined in hsprofile.*.json are not being recognized when used in local.json file.

Use case:
When working with multiple HubSpot accounts (e.g., development, staging, production), developers need an easy way to specify which config profile should be used and have environment-specific variables properly resolved.

Example:

in hsprofile.*.json:

{
  "accountId": 123,
  "variables": {
    "BACKEND_URL": "https://my-dev-backend.example.com",
  }
}

In local.json:

{
  "proxy" {
    "${BACKEND_URL}": "https://localhost:446"
  }
}

In app .hsmeta file:

{
  "permittedUrls": {
    "fetch": ["${BACKEND_URL}"]
  }
}

Actual behavior:
Running hs project dev produces the error:
[WARNING] The key "${BACKEND_URL}" in "local.json" is an invalid url
But it is resolved as a valid URL in permittedUrls.fetch

Expected behavior:
The ${BACKEND_URL} variable should be resolved in local.json from hsprofile.*.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions