Skip to main content
The DevXP engineering team hosts office hours every Thursday at 11 a.m. Pacific Time where we answer your questions live and help you get up and running with Flatfile. Join us!
For a production deployment, listeners can be hosted either in your cloud or directly on the Flatfile platform. While your own cloud provides the maximum level of control over listener code, qualities such as availability and network performance are the responsibility of the hosting provider. Flatfile offers tooling to deploy and manage Listeners securely hosted and run in the Flatfile cloud giving you a more consistent, low-latency, high-availability experience.

Deploying An Agent

Once you have configured your a local configuration running, bundling and deploying your listener to the flatfile cloud can be done in a single command.
The CLI will attempt to locate the entrypoint of your listener in the following order:
  • ./index.js,
  • ./index.ts
  • ./src/index.js
  • ./src/index.ts
If your listener is in another location you can provide the path as an argument:
The CLI will provide updates as it’s deploying:
Set your target environment FLATFILE_ENVIRONMENT_ID and API token FLATFILE_API_KEY in your .env file to avoid entering them when prompted.

Dashboard Management

You can view and manage agents via the Flatfile Dashboard. The dashboard provides a simple interface for monitoring and controlling your deployed agents with the following capabilities:

Re-Deploying

To update the code in your listener simply make the update your desire re-deploy. Agents are versioned and you may revert to a previous version at any time via the dashboard.

Multiple Agents

To deploy a second Agent without overwriting the first, specify a unique slug:
When you pass a slug, the CLI will create a new Agent with the specified slug. This allows you to deploy multiple Agents to the same environment. To update an existing Agent, you can specify the slug of the Agent you want to update by running the same command, including the slug.
If you do not specify a slug and have only one or no deployed Agents the CLI will update your existing Agent, or create your first Agent. The slug for this agent will be default.

Hosting on Regional Servers

To deploy on a regional server, please contact our support team.
Regional servers are available upon request for those needing to host their applications closer to their user base, ensuring faster access and compliance with local data regulations.

URL References

Configuring API URL

When deploying, you can specify the FLATFILE_API_URL either in your project’s .env file or as an environment variable.

Embedding Via Space URL

To embed Flatfile in your application, include both apiUrl and spaceUrl in your FlatfileImporter configuration to specify your regional server:

Configure API Client Environment

For direct API interactions, the FlatfileClient needs the environment parameter set to your selected regional API URL:

Self-Hosting

Hosting listener code in your own cloud works similarly to how we run the develop command in that:
  1. The listener process is launched
  2. It polls the Flatfile API for updates
  3. It then responds to those Events accordingly
Reach out to support for learning how about hosting in your own cloud.
  • develop - Run a local listener for development
  • list - List all deployed agents in your environment
  • download-agent - Download an agent from your environment
  • delete - Delete an agent from your environment