Listeners are the core of Flatfile’s event-driven architecture. They respond to events throughout the data import lifecycle, from space configuration to data validation and job processing. This guide will help you understand how to create and organize listeners effectively.
listener.js
(or listener.ts
for TypeScript):
flatfile develop
command. This will start a local server that will listen for events and respond to them, and will also watch for changes to your listener code and automatically reload the server.
POST /v1/agents
endpoint.
space:configure
- Sets up the data structure (workbook + sheets)job:ready
- Processes data when users submitcommit:created
event listener to detect duplicate (+) email addresses. Records with duplicate emails receive a Warning, while records with emails that appear 3+ times receive an Error.