This is a Flatfile listener that uses the core patterns for building event-driven data import workflows. Listeners are the foundation of Flatfile's architecture—they respond to events throughout the data import lifecycle and enable all the powerful functionality in your Flatfile implementation.
First install the dependencies. We like to use bun for this:
bun installThen copy the .env.example file to .env and add your Flatfile API key and environment ID:
cp .env.example .envNow go to src/index.ts and replace https://webhook.site/... with your own webhook url. You can use webhook.site for this.
Finally, run the listener in development mode:
bun run devbun run dev # starts the listener in development mode
bun run deploy # deploys the listener to Flatfile
bun run list # lists all listeners
bun run delete # deletes the listener
bun run check # checks the code for errors
bun run fix # fixes the code for errors