Skip to main content
Version: Next

ActorVersionCollectionClient

Client for managing the collection of Actor versions.

Actor versions represent specific builds or snapshots of an Actor's code. This client provides methods to list and create versions for a specific Actor.

Hierarchy

  • ResourceCollectionClient
    • ActorVersionCollectionClient
const client = new ApifyClient({ token: 'my-token' });
const actorClient = client.actor('my-actor-id');

// List all versions
const versionsClient = actorClient.versions();
const { items } = await versionsClient.list();

// Create a new version
const newVersion = await versionsClient.create({
versionNumber: '0.2',
sourceType: 'GIT_REPO',
gitRepoUrl: 'https://github.com/my-account/my-actor',
buildTag: 'latest'
});

Index

Properties

inheritedapifyClient

apifyClient: ApifyClient

inheritedbaseUrl

baseUrl: string

inheritedhttpClient

httpClient: HttpClient

optionalinheritedid

id?: string

optionalinheritedparams

params?: Record<string, unknown>

inheritedpublicBaseUrl

publicBaseUrl: string

Added in 2.17.0

inheritedresourcePath

resourcePath: string

optionalinheritedsafeId

safeId?: string

inheritedurl

url: string

Methods

create

list

  • Lists all Actor versions.

    The endpoint returns every version in one response, so awaiting the return value (as you would with a Promise) gets the whole list.

    const { items } = await client.list();

    Asynchronous iteration is also supported, and yields the versions one by one.

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

    Parameters

    Returns Promise<ActorVersionListResult> & AsyncIterable<FinalVersion, any, any>

    The Actor versions, awaitable as a whole list or iterable one by one.