Skip to content
sandbox-workers
Esc
navigateopen⌘Jpreview
On this page

Configuration

Configure your own Worker's wrangler.jsonc for stateless or stateful mode, the runtime Worker's wrangler.jsonc, and guest environment variables.

Configuration differs by mode. In stateless mode, your own Worker needs only a services entry naming the runtime Worker. In stateful mode, your own Worker additionally hosts the Sandbox Durable Object and binds it with durable_objects. Either way, the runtime Worker owns its own Interpreter Durable Object (when it has one), CPU limits, and idle-expiry settings. These pages cover both sides.

  • Wrangler configuration — your Worker’s wrangler.jsonc for each mode, the runtime Service Bindings, and the runtime Worker’s own Durable Object binding, migration, and deploy settings.
  • Bindings — the runtime Service Bindings used by both modes, the Sandbox Durable Object binding stateful mode adds, and binding-name rules that createCodeContext({ binding }) resolves by name.
  • Environment variables — passing envVars to guest code in both modes, layering setEnvVars and context-level vars in stateful mode, and SANDBOX_IDLE_TTL_MS vs. INTERPRETER_IDLE_TTL_MS.