{ "$schema": "http://json-schema.org/draft-07/schema", "$id": "https://denoflare.dev/config", "title": "Denoflare configuration file", "description": "Top-level Denoflare configuration object", "type": "object", "properties": { "scripts": { "description": "Known script definitions, by unique `script-name`.", "type": "object", "propertyNames": { "pattern": "^[a-z][a-z0-9_-]{0,63}$" }, "patternProperties": { ".*": { "description": "Script-level configuration", "type": "object", "required": [ "path" ], "properties": { "path": { "description": "Local file path, or https: url to a module-based worker entry point .ts, or a non-module-based worker bundled .js", "type": "string" }, "bindings": { "description": "Bindings for worker environment variables to use when running locally, or deploying to Cloudflare", "type": "object", "propertyNames": { "pattern": "^[a-zA-Z0-9_]+$" }, "patternProperties": { ".*": { "anyOf": [ { "type": "object", "description": "Plain-text environment variable binding", "required": [ "value" ], "properties": { "value": { "description": "Value is the string value, with the following replacements:\n - `${localPort}` replaced with the localhost port used when running `serve`, the local dev server.\n This can be useful when defining a variable for the server Origin, for example.\n - `${pushId}` replaced with an incremental push identifier used when running `serve`, the local dev server, or `push` --watch.", "type": "string" } } }, { "type": "object", "description": "Secret-text environment variable binding", "required": [ "secret" ], "properties": { "secret": { "description": "Value can be:\n - Secret literal string value\n - `aws:`, replaced with the associated `:` from `~/.aws/credentials`.\nUseful if you want to keep your credentials in a single file.", "type": "string" } } }, { "type": "object", "description": "Workers KV Namespace environment variable binding", "required": [ "kvNamespace" ], "properties": { "kvNamespace": { "description": "For now, this is the underlying Cloudflare API ID of the Workers KV Namespace.", "type": "string" } } }, { "type": "object", "description": "Workers Durable Object Namespace environment variable binding", "required": [ "doNamespace" ], "properties": { "doNamespace": { "description": "For now, this is either:\n - The underlying Cloudflare API ID of the Workers Durable Object Namespace\n - `local:`: Pointer to a Durable Object class name defined in the same worker script. e.g. `local:MyCounterDO`", "type": "string" } } } ] } } }, "localPort": { "description": "If specified, use this port when running `serve`, the local dev server.", "type": "number" }, "localHostname": { "description": "If specified, replace the hostname portion of the incoming `Request.url` at runtime to use this hostname instead of `localhost`.\n\nUseful if your worker does hostname-based routing.", "type": "string" }, "localIsolation": { "description": "If specified, use this isolation level when running `serve`, the local dev server.\n\n(Default: 'isolate')", "type": "string", "enum": ["none", "isolate"], "default": "isolate" }, "profile": { "description": "If specified, use a specific, named Profile defined in `config.profiles`.\n\n(Default: the Profile marked as `default`, or the only Profile defined)", "type": "string" } } } } }, "profiles": { "description": "Profile definitions by unique `profile-name`", "type": "object", "propertyNames": { "pattern": "^[a-z][a-z0-9_-]{0,36}$" }, "patternProperties": { ".*": { "description": "Profile definition, Cloudflare credentials to use when deploying via `push`, or running locally with `serve` using real KV storage.", "type": "object", "required": [ "accountId", "apiToken" ], "properties": { "accountId": { "description": "Cloudflare Account ID: 32-char hex string.\n\nThis value can either be specified directly, or using `regex::` to grab the value from another file.", "type": "string" }, "apiToken": { "description": "Cloudflare API token: Value obtained from the Cloudflare dashboard (My Profile -> [API Tokens](https://dash.cloudflare.com/profile/api-tokens)) when creating the token under this account.\n\nThis value can either be specified directly, or using `regex::` to grab the value from another file.", "type": "string" }, "default": { "description": "If there are multiple profiles defined, choose this one as the default (when no `--profile` is explicitly specified or configured).\n\nThere can only be one default profile.", "type": "string", "pattern": "^[a-z][a-z0-9_-]{0,36}$" } } } } } } }