Forward all Flatfile events to a webhook URL for language-agnostic integration with external systems
**
), packages the full event object as a JSON payload, and sends it via an HTTP POST request.
Parameter | Type | Required | Description |
---|---|---|---|
url | string | Yes | The webhook endpoint URL where the plugin will send all Flatfile events via an HTTP POST request |
callback | function | No | An optional callback function that is executed after the webhook request is complete. Receives data (webhook response) and event (original Flatfile event) as arguments |
options | object | No | Additional configuration options |
options.debug | boolean | No | When set to true , logs any errors that occur during the webhook forwarding process to the console. Default: false |
**
) emitted by the Flatfile listener. For each event, it sends an HTTP POST request to the provided url
with the event object serialized as a JSON string in the request body. If the webhook call fails, the error is suppressed unless options.debug
is set to true
. No action is taken on the webhook’s response unless a callback
function is provided.
debug: true
in the options object to see detailed error messages in your console logs.
url
provided is correct and is publicly accessible from the environment where your Flatfile listener is running.
webhook.site
to test if events are being sent correctly from the plugin.
**
(all events), which can generate a high volume of HTTP requests to your endpoint. Ensure your webhook receiver can handle the potential load.
async
and is await
ed, the plugin does not block the Flatfile event lifecycle.
try...catch
block to handle errors during the fetch
call. If an error occurs (including non-ok HTTP responses like 4xx or 5xx), it will not crash the listener process. Instead, it constructs a standardized error object:
callback
function, if provided. If options.debug
is true
, the original error is also logged to the console.