@flatfile/plugin-webhook-egress


The @flatfile/plugin-webhook-egress plugin egresses Flatfile Workbooks to a webhook.



Event Type:


listener.on('{jobParam}') (i.e. listener.on('workbook:submitActionFg'))

Parameters

job
string
required

The job parameter takes the job name.

url
string
required

The url parameter takes the webhook url.

Imported NPM Packages

Usage

The webhookEgress plugin creates an action that will export workbook data via a webhook. It 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.

install
npm i @flatfile/plugin-webhook-egress @flatfile/listener

workbook.config.json
  // ... inside Workbook configuration
  "actions": [
    {
      operation: 'submitActionFg',
      mode: 'foreground',
      label: 'Send to...',
      type: 'string',
      description: 'Submit this data to a webhook.',
      primary: true,
    }
  ]
  // ...
listener.js
import type { FlatfileListener } from "@flatfile/listener";
import { webhookEgress } from "@flatfile/plugin-webhook-egress";

export default function (listener: FlatfileListener) {
  listener.use(
    webhookEgress("workbook:submitActionFg", "https://webhook.site/...")
  );
}

See the code