@flatfile/plugin-webhook-egress
TypeScript icon, indicating that this package has built-in type declarations

1.6.0 • Public • Published

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.

webhookUrl - string

The webhookUrl parameter takes the webhook url.

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

Import

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

workbook_actions_primary

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

// Using the WEBHOOK_SITE_URL environment variable
listener.use(webhookEgress("workbook:submitActionFg"));

// Passing the webhook url as a parameter
listener.use(webhookEgress("workbook:submitActionFg", "https://webhook.site/...""));

Package Sidebar

Install

npm i @flatfile/plugin-webhook-egress

Weekly Downloads

107

Version

1.6.0

License

ISC

Unpacked Size

29.5 kB

Total Files

12

Last publish

Collaborators

  • meritmalling
  • sambarrowclough
  • carlbrugger
  • mmccooyyy
  • rjhyde
  • flatderek
  • alnoor
  • flatfilecolin
  • bigcountrycrane
  • flatfileinfra
  • bangarang
  • madmandrit
  • jmmander
  • sarocu
  • dboskovic
  • nate.ferrero