When embedding Flatfile, this plugin should be deployed in a server-side.

@flatfile/plugin-webhook-event-forwarder

The @flatfile/plugin-webhook-event-forwarder" plugin listens for Flatfile Events and forwards them to a given endpoint via webhook. This allows for language-agnostic processing of Flatfile Events and allows for receiving data back from the given endpoint for robust processing workflows.

Parameters

url
string

The URL to send the webhook requests to. If not specified it will attempt to get the URL from your environment file. If not specified through either method it will fail.

callback
function

A callback to run after the request completes. If the callback returns data, it will be included in the job:outcome-acknowledged event generated by the request competion.

API Calls

  • api.events.create

Imported NPM Packages

Usage

For workflows which process Flatfile Events outside of the listener file, use the desired endpoint that the webhooks are to be sent to. For testing, use a basic webhook.site endpoint.

install
npm i @flatfile/plugin-webhook-event-forwarder
import { webhookEventForward } from "@flatfile/plugin-webhook-event-forwarder";
listener.ts
listener.use(
  webhookEventForward("https://webhook.site/yourwebhooksitehere", (data) => {
    //do stuff here
  })
);

See the code