wrangler.json file configures the Worker and declares its bindings. It sits at the root of the App. celld, the Judt runtime, reads the Cloudflare Wrangler format, and Judt accepts a subset of its keys. Deploy refuses a file that sets any other key.
File format
Use awrangler.json file or a wrangler.jsonc file. A wrangler.jsonc file can contain comments. Keep only one of them: celld reads wrangler.jsonc first, and deploy refuses a source that has both. The wrangler.toml format isn’t supported, and deploy refuses a source that has only a wrangler.toml file. These cases return the unsupported_deploy_configuration code.
The file must contain one object. The rules on this page apply to both file names.
The following example shows a typical configuration:
wrangler.json
Top-level keys
The following table lists the top-level keys that configure the Worker:Keys for bindings and features
The following table lists the keys that declare bindings and other features, and the page that documents each one:
The following table lists the keys that each entry of the storage bindings accepts. Deploy refuses any other key in an entry.
celld checks the entries of
assets, queues, triggers, workflows, and worker_loaders at deploy. Each feature’s page lists the keys that it accepts.
Names
Each binding name becomes a property ofenv in your code. For example, "binding": "DB" gives env.DB, and a Durable Object binding with "name": "ROOMS" gives env.ROOMS. Names follow these rules:
- A binding name, such as
bindingor a Durable Object binding’sname, must be a JavaScript identifier of up to 64 characters. - Each binding name can appear only one time across
durable_objects,d1_databases,kv_namespaces, andr2_buckets. - A store name, such as
database_name, a KVid, orbucket_name, can contain letters, digits, underscores, and hyphens, and must start with a letter or a digit. The limit is 63 characters. - Each class that the file names, such as a Durable Object’s
class_nameor a Workflow’sclass_name, must be exported from the entry module.
Refused keys
Deploy refuses every top-level key that isn’t in the preceding tables, with theunsupported_deploy_configuration code. The refused keys include the following:
$schemaroutesenvobservabilityaibuildservicescontainers
build script in the package.json file instead of the build key.
Compatibility settings
Keep thecompatibility_date of the App. celld obeys only the compatibility flags in the following table. It accepts all other flags with no effect. Node.js built-in modules are always available, so you don’t need the nodejs_compat flag.
Some flags turn on by default from a compatibility date. To turn one off on a later date, set the flag that the “Off flag” column names.