> ## Documentation Index
> Fetch the complete documentation index at: https://flatfileinc-feat-updatereactquickstart.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# @flatfile/plugin-export-workbook

> A plugin for exporting data in Flatfile to Workbooks.

<Warning>
  When embedding Flatfile, this plugin should be deployed in a server-side
  listener. [Learn more](/orchestration/listeners#listener-types)
</Warning>

<CardGroup cols={1}>
  <Card title="@flatfile/plugin-export-workbook" icon="download">
    <br />

    The `@flatfile/plugin-export-workbook` plugin exports data in a Flatfile Workbook.

    <br />

    <br />

    **Event Type:**

    <br />

    `listener.on('job:ready')` **Supported file types:**

    <br />

    `.xlsx`
  </Card>
</CardGroup>

## Parameters

<ParamField path="debug" type="boolean">
  The `debug` parameter lets you toggle on/off helpful debugging messages for
  development purposes.
</ParamField>

## Imported NPM Packages

* [`@flatfile/api@1.5.14+`](https://www.npmjs.com/package/@flatfile/api)
* [`@flatfile/hooks@1.3.1+`](https://www.npmjs.com/package/@flatfile/hooks)
* [`@flatfile/listener@0.3.15+`](https://www.npmjs.com/package/@flatfile/listener)
* [`remeda@1.14.0+`](https://remedajs.com/) offers a set of utility functions for functional programming and data manipulation in JavaScript, providing a convenient way to work with arrays and objects.
* [`xlsx@0.20.0`](https://sheetjs.com/) allows for reading, writing, and manipulating Microsoft Excel files in JavaScript applications.

## Usage

An action with the operation name of "downloadWorkbook" must be configured on a Workbook (not a Sheet) in order to the plugin to be triggered.

```bash install
npm i @flatfile/plugin-export-workbook
```

```ts import
import { exportWorkbookPlugin } from "@flatfile/plugin-export-workbook";
```

```ts workbook.config.json
  // ... inside Workbook configuration
  "actions": [
    {
      "operation": "downloadWorkbook",
      "mode": "foreground",
      "label": "Download Excel Workbook",
      "description": "Downloads Excel Workbook of Data",
      "primary": true
    }
  ]
  // ...
```

```ts listener.js
listener.use(exportWorkbookPlugin());
```

## See the code

<CardGroup cols={2}>
  <Card title="@flatfile/plugin-export-workbook" href="https://github.com/FlatFilers/flatfile-plugins/tree/main/plugins/export-workbook" icon="github" />
</CardGroup>
