feat: Add APIFY_CONSOLE_URL env variable for local actor runtime#1276
Open
Pijukatel wants to merge 6 commits into
Open
feat: Add APIFY_CONSOLE_URL env variable for local actor runtime#1276Pijukatel wants to merge 6 commits into
APIFY_CONSOLE_URL env variable for local actor runtime#1276Pijukatel wants to merge 6 commits into
Conversation
The CLI printed `https://console.apify.com` links (run/build/dataset/KVS URLs, `apify call` / `apify actors start` output, `apify push`, and the `apify login` browser flow) with the host hardcoded, so pointing the CLI at a non-production environment via `APIFY_CLIENT_BASE_URL` still produced production Console links. Add a shared `getConsoleUrl()` helper that resolves the Console base URL from the environment: an explicit `APIFY_CONSOLE_URL` override wins, otherwise it is derived from `APIFY_CLIENT_BASE_URL` by swapping the `api.` host for `console.`, falling back to the production Console. All previously hardcoded call sites now use it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AqvuTQpZK5N9EiUuU2NAzM
When the Console is a localhost instance (local platform development), default token validation to the local API on port 3333 — the coupling the previous commit dropped. An explicit APIFY_CLIENT_BASE_URL still overrides it, so the "local Console ⇒ local API" convenience is back without hardcoding the pairing in source: both endpoints are driven by APIFY_CONSOLE_URL / APIFY_CLIENT_BASE_URL. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AqvuTQpZK5N9EiUuU2NAzM
Add a "CLI configuration environment variables" section to the environment variables page covering the API/Console base URL overrides, how the Console URL is derived from APIFY_CLIENT_BASE_URL, and the localhost login convenience. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AqvuTQpZK5N9EiUuU2NAzM
Replace the login-only getLoginApiBaseUrl with a shared getApiBaseUrl in console-url.ts and route the ApifyClient creation in utils.ts through it, so the "localhost Console => local API on :3333" default applies to every command, not just login. An explicit APIFY_CLIENT_BASE_URL still overrides it. As a result, setting APIFY_CONSOLE_URL to a localhost instance now also points the API at localhost by default across the whole CLI. Docs and tests updated to match; the login command no longer needs its own resolver. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AqvuTQpZK5N9EiUuU2NAzM
The Console URL is now driven only by APIFY_CONSOLE_URL (or the production default); it is no longer inferred from APIFY_CLIENT_BASE_URL by swapping the api. host. The localhost Console => local API on :3333 fallback is kept, which already covers the local development case. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AqvuTQpZK5N9EiUuU2NAzM
Remove the getApiBaseUrl helper and its CLI-wide use; the ApifyClient once again reads process.env.APIFY_CLIENT_BASE_URL directly in utils.ts, exactly as before. The localhost => local API on :3333 fallback returns to its original login-only scope (now keyed off the resolved Console URL). The Console URL work driven by APIFY_CONSOLE_URL is unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AqvuTQpZK5N9EiUuU2NAzM
This was referenced Jul 14, 2026
Closed
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.
This will be used when using CLI against the local actor runtime development environment.