- EmDash
- Start here
Configuration and settings
Two functions register Flux Importer in your Astro config. Everything else is a setting an Administrator changes in the admin.
Register the plugin
Section titled “Register the plugin”Flux Importer has two parts, and both go in astro.config.mjs:
fluxImporter()goes in EmDash’splugins. It’s the plugin itself: the admin pages, the API and the scheduled tasks. It takes no options.fluxImporterRoutes()goes in Astro’sintegrations. It adds the streamed upload route,/_emdash/api/fluximporter/uploads. EmDash’s plugin routes cap request bodies at 8 MiB, so files are uploaded through this route instead.
Leave out fluxImporterRoutes() and the wizard can’t upload files.
On Node
Section titled “On Node”Use EmDash’s sqlite() database and local() storage:
import node from "@astrojs/node";import react from "@astrojs/react";import { defineConfig } from "astro/config";import emdash, { local } from "emdash/astro";import { sqlite } from "emdash/db";import { fluxImporter, fluxImporterRoutes } from "@fluximporter/emdash";
export default defineConfig({ output: "server", adapter: node({ mode: "standalone" }), integrations: [ react(), emdash({ database: sqlite({ url: "file:./data.db" }), storage: local({ directory: "./uploads", baseUrl: "/_emdash/api/media/file" }), plugins: [fluxImporter()], }), fluxImporterRoutes(), ],});Scheduled imports and log cleanup run on EmDash’s built-in scheduler, which only runs while a Node process is running. Keep one running in production.
On Cloudflare Workers
Section titled “On Cloudflare Workers”Use d1() and r2() from @emdash-cms/cloudflare. Nothing else changes:
import { defineConfig } from "astro/config";import cloudflare from "@astrojs/cloudflare";import react from "@astrojs/react";import emdash from "emdash/astro";import { d1, r2 } from "@emdash-cms/cloudflare";import { fluxImporter, fluxImporterRoutes } from "@fluximporter/emdash";
export default defineConfig({ output: "server", adapter: cloudflare(), integrations: [ react(), emdash({ database: d1({ binding: "DB" }), storage: r2({ binding: "MEDIA" }), plugins: [fluxImporter()], }), fluxImporterRoutes(), ],});On Workers, scheduled imports and log cleanup run on EmDash’s Cron Trigger. Without one they don’t run, though imports from the wizard still work. See Schedules.
fluxImporterRoutes() options
Section titled “fluxImporterRoutes() options”| Option | Default | What it does |
|---|---|---|
maxSourceBytes |
52428800 (50 MiB) |
The largest file the upload route accepts, and the largest URL source it fetches. A positive whole number of bytes. |
allowPrivateNetwork |
false |
Lets URL sources reach private and loopback addresses. Only for local development: production builds ignore it. |
fluxImporterRoutes({ maxSourceBytes: 100 * 1024 * 1024 }),Excel (.xlsx) files have their own limit of 10 MiB, or maxSourceBytes when that is lower. Pasted text is limited to 1 MiB.
Settings
Section titled “Settings”Administrators change the settings on EmDash’s Plugins page, from the settings control on the Flux Importer card. EmDash requires the plugins:manage permission to read or change them.
| Setting | Default | What it does |
|---|---|---|
| Keep import logs for (days) | 30 | Finished jobs and their staged source files older than this are deleted hourly. From 0 to 3650. |
| Mapping suggestions | None (name matching only) | Choose Anthropic (Claude) or OpenAI-compatible endpoint to also get mapping suggestions from AI. |
| Provider API key | empty | The key for the provider above. Stored encrypted. |
| Model | empty | Empty uses claude-opus-5-5 with Anthropic. Required for an OpenAI-compatible endpoint. |
| OpenAI-compatible base URL | empty | Only for an OpenAI-compatible endpoint. |
| URL source credentials | empty | Holds the credentials for URL sources. Don’t edit it here: manage credentials on the Sources tab. |
Keep import logs for (days)
Section titled “Keep import logs for (days)”Every hour, at minute 17 UTC, the importer deletes the finished jobs (completed, cancelled or failed) that were created more than this many days ago, with their record logs, their rollback journal and the staged files no other job needs. Jobs that are still running or paused are kept.
Once a job is deleted, it leaves the Jobs tab, its log can’t be downloaded and it can no longer be rolled back. The entries it wrote stay. Set 0 to delete finished jobs at the next hourly run.
Mapping suggestions
Section titled “Mapping suggestions”With None (name matching only), the Map step matches columns to fields by their names. That always works and sends nothing anywhere.
With a provider, the Map step also asks it for a suggestion. Each request sends the provider the target collection’s name and label; the names, labels, types, required flags and short option lists of the fields name matching didn’t settle; the column or path names of the sample; and up to 5 sample records, each value cut to 200 characters. With Anthropic, the SDK also sends its client details (SDK version, OS, runtime). It never sends IDs, source URLs, credentials or user details. The provider’s own data policy applies.
At most 30 suggestions per UTC hour use the provider. After that, the Map step uses name matching alone until the next hour.
- Provider API key: use a key you can revoke, with a spending limit. With
claude-opus-5-5, one suggestion can cost up to about $0.40, billed even when it times out. Clear the field to remove the key. - Model: for an OpenAI-compatible endpoint, enter the model name as that endpoint names it.
- OpenAI-compatible base URL: the URL before
/chat/completions, for examplehttps://api.example.com/v1. It must behttpson a public host, and the endpoint must support JSON-schema response formats.
See AI mapping for how suggestions show in the wizard.
URL source credentials
Section titled “URL source credentials”This setting stores every credential for URL sources as one encrypted value. Add, replace and delete credentials on the Sources tab instead. Saving other text in this setting removes every credential. See URL sources and credentials.
The encryption key
Section titled “The encryption key”The provider API key and URL source credentials are EmDash secret settings. EmDash encrypts them with EMDASH_ENCRYPTION_KEY, so your site needs that variable set before you save either one.
Generate a key with EmDash’s CLI:
npx emdash secrets generateOn Node, add the value to the server’s environment. On Cloudflare, store it as a Worker secret:
npx wrangler secret put EMDASH_ENCRYPTION_KEYThe key isn’t stored in the database, so a database backup doesn’t include it. Keep it in a secret manager: without it, saved secrets can’t be read. See EmDash’s secrets guide for rotation.
Version compatibility
Section titled “Version compatibility”Each Flux Importer release follows one version of Kumo, EmDash’s UI library, because EmDash’s admin only styles the Kumo version it ships.
| Flux Importer | EmDash | @cloudflare/kumo |
|---|---|---|
| 0.8 | 1.6 | 2.19.0 |
| 0.7 | 1.2 to 1.4 | 2.6.0 |
EmDash 1.5 (Kumo 2.15.0) has no matching release. Update EmDash to 1.6.
Upgrading
Section titled “Upgrading”- Update
@fluximporter/emdashandemdashtogether. When an EmDash release moves its admin to a new Kumo version, a Flux Importer release follows with the matching@cloudflare/kumoversion. - Turn Agent access off and on again after an upgrade that changes the MCP tools. EmDash stops serving the tools until an Administrator does, even though the switch on the Plugins page still shows them on. See Imports from AI agents.
- Read the release notes. Releases before 1.0 may change stored data or options; the release notes say how.