All docs / Build
Configuration file
Every wrangler.jsonc / wrangler.toml key rrangler reads, with environments, builds, crons and placement.
Open in the consolerrangler reads the first of rrangler.json, rrangler.jsonc, rrangler.toml, wrangler.json, wrangler.jsonc and wrangler.toml in the project folder. The keys are wrangler's, so an existing Cloudflare project usually deploys unchanged. The console and Studio do not need this file, but keeping one makes a project deployable from any computer.
A complete example
{
"name": "short-links", // the app's slug; created on first deploy
"main": "src/index.js", // entry: .js, .ts or .py
"compatibility_date": "2026-09-22",
"compatibility_flags": ["nodejs_compat"],
"build": { "command": "npm run build" }, // runs before bundling
"vars": { "BASE_URL": "https://s.example.com" },
"kv_namespaces": [{ "binding": "CACHE", "title": "short-links-cache" }],
"d1_databases": [{ "binding": "DB", "database_name": "short-links-db" }],
"r2_buckets": [{ "binding": "FILES", "bucket_name": "short-links-files" }],
"queues": { "producers": [{ "binding": "JOBS", "queue": "short-links-jobs" }] },
"services": [{ "binding": "AUTH", "service": "auth-api" }],
"durable_objects": { "bindings": [{ "name": "ROOM", "class_name": "ChatRoom" }] },
"workflows": [{ "name": "cleanup", "binding": "CLEANUP", "class_name": "Cleanup" }],
"triggers": { "crons": ["0 3 * * *"] },
"assets": { "directory": "./public", "binding": "ASSETS", "spa": false },
"placement": { "mode": "smart" },
"env": {
"staging": {
"vars": { "BASE_URL": "https://staging.s.example.com" },
"d1_databases": [{ "binding": "DB", "database_name": "short-links-db-staging" }]
}
}
}