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

[@salesforce/b2c-tooling-sdk](../../modules.md) / [config](../index.md) / updateInstanceConfig

# Function: updateInstanceConfig()

> **updateInstanceConfig**(`patch`, `options`): `Promise`\<\{ `name?`: `string`; `path`: `string`; \}\>

Defined in: [packages/b2c-tooling-sdk/src/config/dw-json.ts:557](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/bceb8da43dd8bc63d57932bbd905d36a1b40c949/packages/b2c-tooling-sdk/src/config/dw-json.ts#L557)

Updates fields of an existing instance config in dw.json.

Fields are written in kebab-case (e.g. `webdav-hostname`). Any existing key
that resolves to the same field — a camelCase or legacy alias such as
`webdav-server` or `passphrase` — is replaced so the new value takes effect.
Fields set to `undefined` are removed.

## Parameters

### patch

`Partial`\<[`DwJsonConfig`](../interfaces/DwJsonConfig.md)\>

Fields to set, using canonical camelCase names

### options

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

dw.json location and target instance

## Returns

`Promise`\<\{ `name?`: `string`; `path`: `string`; \}\>

The path of the updated dw.json and the name of the updated instance

## Throws

Error if dw.json doesn't exist or the instance is not found
