Skip to content

feat: upgrade apify-client to v3 - #1644

Draft
B4nan wants to merge 4 commits into
masterfrom
chore/apify-client-v3
Draft

B4nan wants to merge 4 commits into
masterfrom
chore/apify-client-v3

Conversation

@B4nan

@B4nan B4nan commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Moves the CLI from apify-client v2 to v3, so API requests go through fetch instead of axios. package.json pins ^3.0.0-rc.2, which also covers the stable release.

Most of the diff is renamed model types and the null checks that come with them. The rest:

  • The "local runtime isn't running" check is a fetch wrapper on a FetchHttpClient now (createApifyClient()), since axios interceptors are gone. Default headers go through the client's headers option.
  • Log streaming and key-value-stores get-value read web streams.
  • The bundle build no longer injects proxy-agent.

What changes for users:

  • Node.js 22.15 is the minimum (was 22.0), because the client requires it.
  • HTTP_PROXY/HTTPS_PROXY keep working on Node.js 24.14+ (the CLI calls http.setGlobalProxyFromEnv() at startup) and in the Bun bundles. On an older Node.js they need NODE_USE_ENV_PROXY=1 (22.21+). The CLI's own fetch calls go through the proxy now too.
  • set-value with a non-JSON string and the default JSON content type stores the string as is. Axios used to wrap it in quotes.
  • URL fields are normalized, so a run's container URL prints with a trailing slash.
  • API calls time out per tier (5/30/360 s, growing with retries) instead of a flat 360 s, and a response that doesn't match the API schema fails.

Moves the CLI to apify-client v3 (`^3.0.0-beta.115`, the first published
build with web streams), which sends requests through `fetch` instead of
axios.

- Model types follow the renamed OpenAPI names, with the new null checks.
- The local runtime "not running" check is a `fetch` wrapper on a
  `FetchHttpClient` instead of an axios adapter; default headers use the
  client's `headers` option.
- Log streaming and `key-value-stores get-value` consume web streams.
- Actor version uploads in `push` use the long timeout tier, since most
  calls now default to 5 seconds instead of 360.
- The bundle build no longer injects `proxy-agent`, which the client
  dropped.
- Minimum Node.js is 22.15, as the client requires.
@B4nan B4nan added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Nov 25, 2026
@pkg-pr-new

pkg-pr-new Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npx https://pkg.pr.new/apify-cli@1644

commit: 6e74258

B4nan added a commit to apify/apify-client-js that referenced this pull request Nov 25, 2026
`versions().create()` and `version().update()` can carry the version's
source files, which is megabytes of body, but they defaulted to the 5 s
`short` tier. A body that isn't a stream has to be sent within the
timeout, so a slow uplink kept re-uploading it across retries. Both
default to `long` now. Found while moving the CLI to v3 in
apify/apify-cli#1644.

The proxy docs also mention `http.setGlobalProxyFromEnv()` (Node.js
24.14+), for tools that can't control how Node.js is started.
apify-client v3 no longer reads `HTTP_PROXY`/`HTTPS_PROXY` itself, so the
CLI turns the proxy on at startup with `http.setGlobalProxyFromEnv()`
when one of them is set. That needs Node.js 24.14; older versions still
need `NODE_USE_ENV_PROXY=1`, and the Bun bundles read the variables on
their own.
The RC defaults Actor version uploads to the long timeout tier itself,
so `push` no longer passes it.
@B4nan
B4nan marked this pull request as draft November 25, 2026 22:58

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant