---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../../modules.md) / [operations/cap](../index.md) / pullCommerceApps

# Function: pullCommerceApps()

> **pullCommerceApps**(`instance`, `features`, `options`): `Promise`\<[`PullCommerceAppsResult`](../interfaces/PullCommerceAppsResult.md)\>

Defined in: [packages/b2c-tooling-sdk/src/operations/cap/pull.ts:83](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/9c8c448223735b087738106fca3bc4c8e812ceb7/packages/b2c-tooling-sdk/src/operations/cap/pull.ts#L83)

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`](../../../instance/classes/B2CInstance.md)

The B2C Commerce instance to pull apps from.

### features

[`CommerceFeatureState`](../interfaces/CommerceFeatureState.md)[]

Array of CommerceFeatureState objects representing installed apps.

### options

[`PullCommerceAppsOptions`](../interfaces/PullCommerceAppsOptions.md) = `{}`

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

## Returns

`Promise`\<[`PullCommerceAppsResult`](../interfaces/PullCommerceAppsResult.md)\>

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);
}
```
