Skip to main content
Version: Next

ActorEnvVarCollectionClient

Client for managing the collection of environment variables for an Actor version.

Environment variables are key-value pairs that are available to the Actor during execution. This client provides methods to list and create environment variables.

@example
const client = new ApifyClient({ token: 'my-token' });
const actorClient = client.actor('my-actor-id');
const versionClient = actorClient.version('0.1');

// List all environment variables
const envVarsClient = versionClient.envVars();
const { items } = await envVarsClient.list();

// Create a new environment variable
const newEnvVar = await envVarsClient.create({
name: 'MY_VAR',
value: 'my-value',
isSecret: false
});
@see

Hierarchy

  • ResourceCollectionClient
    • ActorEnvVarCollectionClient

Index

Properties

inheritedapifyClient

apifyClient: ApifyClient

inheritedbaseUrl

baseUrl: string

inheritedhttpClient

httpClient: HttpClient

optionalinheritedid

id?: string

optionalinheritedparams

params?: Record<string, unknown>

inheritedpublicBaseUrl

publicBaseUrl: string

inheritedresourcePath

resourcePath: string

optionalinheritedsafeId

safeId?: string

inheritedurl

url: string

Methods

create

list

  • Lists all environment variables of this Actor version.

    Awaiting the return value (as you would with a Promise) will result in a single API call. The amount of fetched items in a single API call is limited.

    const paginatedList = await client.list(options);

    Asynchronous iteration is also supported. This will fetch additional pages if needed until all items are retrieved.

    for await (const singleItem of client.list(options)) {...}
    @see

    Parameters

    Returns Promise<ActorEnvVarListResult> & AsyncIterable<ActorEnvironmentVariable, any, any>

    A paginated iterator of environment variables.