Developer Preview — This project is in active development. APIs may change. Provide feedback
Skip to content

@salesforce/b2c-tooling-sdk / operations/jobs / siteArchiveExportToPath

Function: siteArchiveExportToPath()

siteArchiveExportToPath(instance, dataUnits, outputPath, options): Promise<SiteArchiveExportResult & object>

Defined in: packages/b2c-tooling-sdk/src/operations/jobs/site-archive.ts:577

Exports a site archive, downloads it, and saves it to a local path.

Runs the export job on the instance, downloads the archive via WebDAV, and saves it locally. Optionally keeps the archive on the instance.

Parameters

instance

B2CInstance

B2C instance to export from

dataUnits

Partial<ExportDataUnitsConfiguration>

Data units configuration

outputPath

string

Local path to save the archive

options

SiteArchiveExportOptions & object = {}

Export and download options

Returns

Promise<SiteArchiveExportResult & object>

Export result with local path

Example

typescript
// Export and save to a directory (extracts zip)
await siteArchiveExportToPath(instance, { global_data: { meta_data: true } }, './exports');

// Export and save as zip
await siteArchiveExportToPath(instance, { global_data: { meta_data: true } }, './exports/archive.zip');

Released under the Apache-2.0 License.