# @univerjs-pro/exchange-client

- Human documentation: [https://docs.univer.ai/reference/packages/plugins/univerjs-pro/exchange-client](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/exchange-client)

- Agent Markdown: [https://docs.univer.ai/reference/packages/plugins/univerjs-pro/exchange-client.md](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/exchange-client.md)

- Requested language: `en-US`

- Content language: `en-US`

- Documentation version: `1.0.0-rc.0`

- Source: [packages/plugins/univerjs-pro/exchange-client.mdx](https://github.com/dream-num/documentation/blob/dev/content/reference/packages/plugins/univerjs-pro/exchange-client.mdx)

---

Shared import and export client integration for Web SDK units.

```typescript
// [!code word:UniverExchangeClientPlugin]
import { UniverExchangeClientPlugin } from '@univerjs-pro/exchange-client'

import '@univerjs-pro/exchange-client/lib/index.css'

univer.registerPlugin(UniverExchangeClientPlugin, config)
```

## Entry Points

* Facade: `@univerjs-pro/exchange-client/facade`
* Locale: `@univerjs-pro/exchange-client/locale/*`
* Style: `@univerjs-pro/exchange-client/lib/index.css`

## Facade Utilities

Import the Facade entry and call exchange utilities through `univerAPI`:

```typescript
import '@univerjs-pro/exchange-client/facade'

if (file) univerAPI.downloadFile(file, 'univer', 'xlsx')
```

The shared Facade entry only adds `downloadFile(file, filename, fileExt)`. Import, export, and snapshot conversion methods live in the corresponding host package Facade: `bases-exchange-client`, `boards-exchange-client`, `docs-exchange-client`, `pdfs-exchange-client`, `sheets-exchange-client`, or `slides-exchange-client`.

## Plugin configuration

```ts
interface IExchangeClientPluginConfig {
  /**
   * The URL of the endpoint for downloading files.
   * @default 'location.origin'
   */
  downloadEndpointUrl?: string
  uploadFileServerUrl?: string
  importServerUrl?: string
  exportServerUrl?: string
  getTaskServerUrl?: string
  signUrlServerUrl?: string
  maxTimeoutTime?: number
}
```

## Request options

```ts
export interface IExchangeImportOptions {
  sheet?: IExchangeSheetImportOption
  base?: IExchangeBaseImportOption
}

export interface IExchangeExportOptions {
  sheet?: IExchangeSheetExportOption
  base?: IExchangeBaseExportOption
}
```

`IImportRequest.options` and `IExportRequest.options` now group format-specific settings by unit kind. Base requests use `ExchangeBaseImportMode`, `ExchangeBaseExportMode`, and `ExchangeBaseFormulaPolicy`. `ExchangeFormat` supports `xlsx`, `csv`, `tsv`, `docx`, `pptx`, and `pdf`.
