Skip to content

feat: configurable API and Console base URLs via env vars#1275

Closed
Pijukatel wants to merge 1 commit into
masterfrom
claude/api-console-env-vars-nel6s3
Closed

feat: configurable API and Console base URLs via env vars#1275
Pijukatel wants to merge 1 commit into
masterfrom
claude/api-console-env-vars-nel6s3

Conversation

@Pijukatel

@Pijukatel Pijukatel commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Description

The Apify Console URL was hardcoded across many commands (8 sites), and the API base URL could only be overridden through the older APIFY_CLIENT_BASE_URL variable. Local, staging, and custom-port setups were awkward, and there was no way to redirect Console links at all.

  • API base URL: explicit flag > APIFY_API_BASE_URL > APIFY_CLIENT_BASE_URL (kept as a lower-priority fallback for existing users) > default.
  • Public API base URL: forwarded from APIFY_API_PUBLIC_BASE_URL (independent of the API base) via the same getApifyClientOptions chokepoint, so a locally-pointed CLI reaches a local public API.
  • Console URL: every printed/opened Console link is composed from a single APIFY_CONSOLE_BASE_URL resolver (origin only, default https://console.apify.com), preserving each link's own path and fragment (e.g. /settings/integrations, #/builds/).
  • Preserved workflow: the login "Console on localhost ⇒ API on localhost:3333" default still applies, but is now overridable by any API-base env var (APIFY_API_BASE_URL or the legacy APIFY_CLIENT_BASE_URL) or an explicit flag.

Ports are just part of the URL. Setting nothing reproduces today's behavior exactly.

Context

This is one of three sibling PRs applying the API / public-API env-var contract across the Apify clients and CLI. Separate repos, no overlapping files:

What we're solving: the Apify Console URL was hardcoded across many commands and
the API base URL could only be overridden through the older APIFY_CLIENT_BASE_URL
variable, making local, staging, and custom-port setups awkward.

How: the API base URL resolves as explicit flag > APIFY_API_BASE_URL >
APIFY_CLIENT_BASE_URL (kept as a fallback) > default; the public API base URL is
forwarded from APIFY_API_PUBLIC_BASE_URL with the same precedence; and every
Console link is composed from a single APIFY_CONSOLE_BASE_URL resolver (origin
only, default https://console.apify.com), preserving each link's own path and
fragment. The login "Console on localhost implies API on localhost:3333" default
is preserved but is now overridable by any API-base env var or flag. Setting
nothing reproduces today's behavior.

Alternatives considered: replacing APIFY_CLIENT_BASE_URL outright, rejected to
avoid breaking existing users.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012bXf84xVdv32VQAt916Ygj
@Pijukatel

Copy link
Copy Markdown
Contributor Author

Close in favor of smaller CLI update: #1276

@Pijukatel Pijukatel closed this Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants