Skip to content

Support shared env vars in the Python client #1224

Open

Description

@DaveHanns

This issue adds shared env vars (variables that are stored once per account and that Actor version env vars reference by name) to the Python client, with the same operations as the JavaScript client (apify/apify-client-js#1209). It also lets an Actor env var hold a reference (shared_env_var_name) in place of a value.

Scope

  • Add shared_env_vars() and shared_env_var(name) clients with the same operations as the JavaScript client, sync and async. The collection client has list and create. The client of one variable has get, update, delete with a force option, and usage with paging.
  • Check how the name gets into the URL path. Proposed: a stored name holds only letters, digits, and _ (apify/apify-core#32547), and such a name needs no special handling. If stored names keep the rule of version env vars instead, send the name as one URL-encoded path segment, without the replacement of / by ~ that the resource clients apply to IDs (to_safe_id in src/apify_client/_utils/http.py). With that replacement, the name A/B would be sent as A~B.
  • Add shared_env_var_name to the env var models, regenerated from OpenAPI. Version create and update validate their env_vars with EnvVarRequest, so they accept a reference after that.
  • Add a shared_env_var_name argument to create and update of the Actor env var clients, and make value optional there. Both require value today.
  • Add integration tests next to the ones for Actor env vars (tests/integration/). They call the live API with the test user's token. Until the release, a feature flag closes the store for accounts without it, so that account needs the flag.

Done when

  • Unit and integration tests cover the new clients, sync and async, and a reference on an Actor env var.
  • A release with the new clients is on PyPI.

Depends on

Activity

  1. added theissue type on Nov 11, 2026
  2. added
    t-builders
    on Nov 11, 2026
  3. added
    t-tooling
    on Nov 11, 2026
  4. removed
    t-tooling
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    t-builders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions