Skip to content

feat: Add APIFY_CONSOLE_URL env variable for local actor runtime#1276

Open
Pijukatel wants to merge 6 commits into
masterfrom
claude/hardcoded-apify-urls-cli-e7jnyj
Open

feat: Add APIFY_CONSOLE_URL env variable for local actor runtime#1276
Pijukatel wants to merge 6 commits into
masterfrom
claude/hardcoded-apify-urls-cli-e7jnyj

Conversation

@Pijukatel

Copy link
Copy Markdown

This will be used when using CLI against the local actor runtime development environment.

claude added 6 commits July 10, 2026 13:10
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
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