Flatfile is an event-based system. This means that an Event is published on almost any interaction a user has within the Flatfile platform. A Listener is a function that is triggered by an Event. It’s a powerful building block because it can be completely customized, enabling you to respond to events precisely the way your business and workflow require. In this step of the tutorial, you’ll learn how to set up a Listener to receive Events.Documentation Index
Fetch the complete documentation index at: https://flatfileinc-update-listeners.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
About listeners
Let’s take a look at a basic listener.Setup your first listener
Let’s walk through setting up your first listener. To do this, you’ll be using some of the tools Flatfile provides for developers.Flatfile is a Typescript/Javascript platform, so you will need to install
Node.js to use all the tools Flatfile provides developers. Though not
required, switch to Node.js v18 for the best experience.
.env file at the root of your cloned repository.
FLATFILE_API_KEY value, setting it to your Secret Key.
Run your first listener
Now that you have listener code configured with credentials, you’re ready to listen for Events. We’ll run this listener locally by using the “develop” command from the Flatfile CLI. You may chose to run either a Typescript or a Javascript version of this listener:console