Wrangler configuration
The minimum required configuration for using Sandbox SDK:
{ "name": "my-sandbox-worker", "main": "src/index.ts", "compatibility_date": "2025-10-13", "compatibility_flags": ["nodejs_compat"], "containers": [ { "class_name": "Sandbox", "image": "./Dockerfile", }, ], "durable_objects": { "bindings": [ { "class_name": "Sandbox", "name": "Sandbox", }, ], }, "migrations": [ { "new_sqlite_classes": ["Sandbox"], "tag": "v1", }, ],}name = "my-sandbox-worker"main = "src/index.ts"compatibility_date = "2025-10-13"compatibility_flags = [ "nodejs_compat" ]
[[containers]]class_name = "Sandbox"image = "./Dockerfile"
[[durable_objects.bindings]]class_name = "Sandbox"name = "Sandbox"
[[migrations]]new_sqlite_classes = [ "Sandbox" ]tag = "v1"The Sandbox SDK is built on Cloudflare Containers. Your configuration requires three sections:
- containers - Define the container image (your runtime environment)
- durable_objects.bindings - Bind the Sandbox Durable Object to your Worker
- migrations - Initialize the Durable Object class
The minimal configuration shown above includes all required settings. For detailed configuration options, refer to the Containers configuration documentation.
Error: TypeError: env.Sandbox is undefined
Solution: Ensure your wrangler.jsonc includes the Durable Objects binding:
{ "durable_objects": { "bindings": [ { "class_name": "Sandbox", "name": "Sandbox", }, ], },}[[durable_objects.bindings]]class_name = "Sandbox"name = "Sandbox"Error: Durable Object not initialized
Solution: Add migrations for the Sandbox class:
{ "migrations": [ { "new_sqlite_classes": ["Sandbox"], "tag": "v1", }, ],}[[migrations]]new_sqlite_classes = [ "Sandbox" ]tag = "v1"- Transport modes - Configure HTTP vs WebSocket transport
- Wrangler documentation - Complete Wrangler reference
- Durable Objects setup - DO-specific configuration
- Dockerfile reference - Custom container images
- Environment variables - Passing configuration to sandboxes
- Get Started guide - Initial setup walkthrough