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

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

# Function: commerceAppInstall()

> **commerceAppInstall**(`instance`, `target`, `options`): `Promise`\<[`CommerceAppInstallResult`](../interfaces/CommerceAppInstallResult.md)\>

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

Installs a Commerce App Package (CAP) on a B2C Commerce instance.

Accepts a local directory or zip file. Reads the commerce-app.json manifest
to determine app name, version, and domain. Uploads the zip to WebDAV and
executes the sfcc-install-commerce-app system job.

## Parameters

### instance

[`B2CInstance`](../../../instance/classes/B2CInstance.md)

B2C instance to install to

### target

`string`

Path to a CAP directory or .zip file

### options

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

Install options including required siteId

## Returns

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

Install result with job execution details

## Throws

JobExecutionError if the install job fails

## Example

```typescript
const result = await commerceAppInstall(instance, './commerce-avalara-tax-app-v0.2.5', {
  siteId: 'RefArch',
});
```
