feat: configurable API and Console base URLs via env vars#1275
Closed
Pijukatel wants to merge 1 commit into
Closed
feat: configurable API and Console base URLs via env vars#1275Pijukatel wants to merge 1 commit into
Pijukatel wants to merge 1 commit into
Conversation
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
Contributor
Author
|
Close in favor of smaller CLI update: #1276 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_URLvariable. Local, staging, and custom-port setups were awkward, and there was no way to redirect Console links at all.APIFY_API_BASE_URL>APIFY_CLIENT_BASE_URL(kept as a lower-priority fallback for existing users) > default.APIFY_API_PUBLIC_BASE_URL(independent of the API base) via the samegetApifyClientOptionschokepoint, so a locally-pointed CLI reaches a local public API.APIFY_CONSOLE_BASE_URLresolver (origin only, defaulthttps://console.apify.com), preserving each link's own path and fragment (e.g./settings/integrations,#/builds/).localhost:3333" default still applies, but is now overridable by any API-base env var (APIFY_API_BASE_URLor the legacyAPIFY_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: