Skip to content
View as Markdown
View as Markdown

@salesforce/b2c-tooling-sdk / operations/cap / pullCommerceApps

Function: pullCommerceApps()

pullCommerceApps(instance, features, options): Promise<PullCommerceAppsResult>

Defined in: packages/b2c-tooling-sdk/src/operations/cap/pull.ts:83

Pulls installed Commerce Apps from a B2C Commerce instance or GitHub repository.

Attempts to download installed app packages from WebDAV on the instance first, with fallback to the official GitHub repository if not found on the instance. Extracts the downloaded zip archives to local directories.

Parameters

instance

B2CInstance

The B2C Commerce instance to pull apps from.

features

CommerceFeatureState[]

Array of CommerceFeatureState objects representing installed apps.

options

PullCommerceAppsOptions = {}

Pull configuration options (e.g., outputDir for extraction).

Returns

Promise<PullCommerceAppsResult>

A promise resolving to a result object containing successfully pulled apps and any failures.

Example

typescript
const result = await listInstalledApps(instance);
const pullResult = await pullCommerceApps(instance, result.features, {
  outputDir: './commerce-apps',
});
console.log(`Successfully pulled ${pullResult.pulled.length} app(s)`);
if (pullResult.failed.length > 0) {
  console.error('Failed to pull apps:', pullResult.failed);
}

Released under the Apache-2.0 License.