@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
The B2C Commerce instance to pull apps from.
features
Array of CommerceFeatureState objects representing installed apps.
options
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
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);
}