Skip to content

Commit

Permalink
Webhook egress (#765)
Browse files Browse the repository at this point in the history
* Webhook egress

* Update webhook.mdx

* Update webhook.mdx
  • Loading branch information
carlbrugger authored Sep 13, 2023
1 parent d88e980 commit 9459b72
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
64 changes: 64 additions & 0 deletions plugins/egress/webhook.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: "@flatfile/plugin-webhook-egress"
description: "A plugin for egressing data from a Flatfile Workbook to a webhook."
icon: "download"
---

<CardGroup cols={1}>
<Card title="@flatfile/plugin-webhook-egress" icon="download">
<br />
The `@flatfile/plugin-webhook-egress` plugin egresses Flatfile Workbooks to a
webhook.
<br />
<br />
**Event Type:**
<br />
`listener.on('{jobParam}')` (i.e. `listener.on('workbook:submitActionFg')`)
</Card>
</CardGroup>

## Parameters

<ParamField path="job" type="string" required>
The `job` parameter takes the job name.
</ParamField>

<ParamField path="webhookUrl" type="string">
The `webhookUrl` parameter takes the webhook url.
</ParamField>

## Imported NPM Packages

- [`@flatfile/[email protected]+`](https://www.npmjs.com/package/@flatfile/api)
- [`@flatfile/[email protected]+`](https://www.npmjs.com/package/@flatfile/listener)
- [`@flatfile/[email protected]+`](https://www.npmjs.com/package/@flatfile/plugin-job-handler)
- [`@flatfile/[email protected]+`](https://www.npmjs.com/package/@flatfile/util-common)
- [`[email protected]+`](https://www.npmjs.com/package/axios)

## Usage

The `webhookEgress` plugin requires an operation parameter which specifies the event that will
initiate the egress. The webhook url can either be passed in as a parameter or set as an environment
variable `WEBHOOK_SITE_URL`.

```SSH install
npm i @flatfile/plugin-webhook-egress
```

```ts import
import { webhookEgress } from "@flatfile/plugin-webhook-egress";
```

```ts listener.js
listener.use(webhookEgress("workbook:submitActionFg"));
```

## See the code

<CardGroup cols={2}>
<Card
title="@flatfile/plugin-webhook-egress"
href="https://github.com/FlatFilers/flatfile-plugins/tree/main/plugins/webhook-egress"
icon="github"
></Card>
</CardGroup>
2 changes: 1 addition & 1 deletion plugins/export/workbook.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ listener.use(exportWorkbookPlugin());

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

0 comments on commit 9459b72

Please sign in to comment.