Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nickruigrok/baseflare/llms.txt
Use this file to discover all available pages before exploring further.
baseflare.config.ts in your project root is the committed configuration file for your Baseflare project. It uses defineConfig() from baseflare/server to declare settings that the CLI reads on every deploy, dev, and generate operation. Because this file is always TypeScript, you get autocompletion and validation at both edit time and runtime — defineConfig() validates every option eagerly and throws a descriptive error if anything is misconfigured.
Full Configuration Reference
The example below shows every available option with inline documentation:baseflare.config.ts is committed to version control. Never put credentials, API tokens, or secrets in it. Use Worker Secrets (managed via baseflare secrets set) or environment variables for sensitive values.project
Required. A non-empty string slug that identifies your project. The CLI uses this value to name all Cloudflare resources it provisions:
- Worker:
bf-{project}-{env} - D1 database:
bf-{project}-{env}-db - R2 bucket:
bf-{project}-{env}-files
project entirely causes defineConfig() to throw immediately:
.baseflare/project.json using their IDs.
functions
Optional. The relative path to your functions directory. Defaults to 'baseflare', which resolves to a baseflare/ folder in your project root.
schema.ts, rules.ts, query/mutation/action modules, and the HTTP router. Nested folders within the functions directory become namespaces in the generated _generated/api.ts object:
functions at any relative path:
defineConfig() to throw.
cors
Optional. CORS policy applied to all RPC and HTTP routes served by the Worker. If omitted, no CORS headers are added (browsers calling the Worker from a different origin will be blocked by default browser policy).
cors.origins
An array of allowed origin strings. Each entry must be a non-empty string — empty strings cause defineConfig() to throw:
'http://localhost:5173' or whichever port your frontend dev server uses alongside your production domain.
cors.maxAge
Optional. Integer number of seconds that the browser may cache a preflight (OPTIONS) response. Must be a non-negative integer:
86400 (24 hours) is a reasonable default for production. Setting it to 0 disables preflight caching.
limits
Optional. Runtime safety limits applied during request execution.
limits.maxQueryResults
Optional. A positive integer cap on the number of documents an unbounded .collect() call may return in a single query. Must be a positive integer:
.paginate() instead of raising this limit arbitrarily.
limits.maxUploadSize
Optional. A non-empty string describing the maximum allowed file upload size, for example '10mb', '5mb', or '50mb'. The value must be a non-empty string:
worker
Optional. Settings passed to the Cloudflare Workers API on every deploy.
worker.compatibilityDate
Optional. A date string in YYYY-MM-DD format that pins which version of the Cloudflare Workers runtime your Worker targets. Cloudflare uses this date to gate breaking runtime changes:
worker.compatibilityFlags
Optional. An array of non-empty strings for additional Cloudflare compatibility flags. Each entry must be a non-empty string:
nodejs_compat is always injected automatically by the CLI — it is required for process.env, npm package support, and auth integrations. You do not need to add it yourself. Any flags you list in compatibilityFlags are appended on top of nodejs_compat.Unknown Options
defineConfig() performs strict key validation. Passing an unrecognised top-level key (or an unrecognised key inside cors, limits, or worker) causes an immediate error:
project, functions, external, cors, limits, middleware, worker.