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

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

# Function: reloadCodeVersion()

> **reloadCodeVersion**(`instance`, `codeVersionId?`): `Promise`\<`void`\>

Defined in: [packages/b2c-tooling-sdk/src/operations/code/versions.ts:108](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/e7c16f1ae423da0aa47b3e10be88f9770b53619b/packages/b2c-tooling-sdk/src/operations/code/versions.ts#L108)

Reloads (re-activates) the current code version.

This performs a "toggle" activation - first activating a different code version,
then re-activating the target version. This forces the instance to reload the code.

## Parameters

### instance

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

B2C instance

### codeVersionId?

`string`

Code version to reload (defaults to current active)

## Returns

`Promise`\<`void`\>

## Throws

Error if reload fails or no alternate version is available

## Example

```typescript
// Reload the currently active code version
await reloadCodeVersion(instance);

// Reload a specific code version
await reloadCodeVersion(instance, 'v1');
```
