Releases: cloudflare/sandbox-sdk
@cloudflare/sandbox@0.12.2
@cloudflare/sandbox@0.12.1
Patch Changes
- #748
ab6206aThanks @ghostwriternr! - Recover automatically from transient infrastructure failures when the SDK opens its WebSocket control connection to a sandbox. Previously, any 5xx response other than 503 on the upgrade would fail the SDK call even when the container was healthy.
@cloudflare/sandbox@0.12.0
Minor Changes
- #739
9b4b1daThanks @scuffi! - Remove the desktop client API and desktop Docker image variant. Thesandbox.desktopAPIs,DesktopClientexports, desktop-related types/errors, and-desktopcontainer image are no longer available.
Patch Changes
-
#727
2acbd24Thanks @scuffi! - AddcredentialProxyoption tomountBucketto keep real S3 credentials out of the container. When enabled, the Durable Object intercepts and signs outbound S3 requests — the container only sees dummy credentials. Supports S3-compatible endpoints, R2, and GCS HMAC signing, with optimized R2 mount defaults for reliable read and write performance. -
#736
28b5dfaThanks @scuffi! - Fix bucket mounts when a Sandbox class defines a catch-all outbound handler by routing SDK-managed mount hosts through the SDK ContainerProxy. -
#737
93c74e3Thanks @scuffi! - Fix phantomrunningprocesses after a failedstartProcesscall. When the underlying session was unavailable or threw during startup, the process record was left in memory with statusrunningand would appear inlistProcesses()indefinitely. Failed startups are now correctly marked as terminalerrorrecords.
@cloudflare/sandbox@0.11.0
Minor Changes
-
#708
287ec04Thanks @ghostwriternr! - Prevent stale preview URLs from waking or reaching sandbox runtimes. Invalid, revoked, or destroyed preview URLs return404 INVALID_TOKEN; authorized URLs that are not activated for the current runtime return410 STALE_PREVIEW_URLuntil the port is exposed again. Existing preview URLs that previously survived container restart now return410 STALE_PREVIEW_URLafter a restart until the port is exposed again in the new runtime.getExposedPorts()andisPortExposed()now report only ports that are currently preview-forwardable in the active runtime.unexposePort()is now idempotent: revoking a port that is not currently exposed succeeds without contacting the container. Preview URL state no longer uses the container-local exposed-port registry or proxy routes.
Patch Changes
-
#733
d4a739bThanks @scuffi! - Allow backup and restore presigned URLs to target non-default R2 endpoints. SetBACKUP_BUCKET_ENDPOINT, for examplehttps://<account_id>.eu.r2.cloudflarestorage.com, when your backup bucket uses an R2 jurisdiction. -
#732
8b9ec84Thanks @ghostwriternr! - Add bridge endpoints for managing tunnels to sandbox services. HTTP clients can callPOST /v1/sandbox/:id/tunnel/:portwith an optionalnamebody field for a predictable named URL, andDELETE /v1/sandbox/:id/tunnel/:portto remove the tunnel. -
#730
de68927Thanks @ghostwriternr! - Classify Office Open XML files such as.xlsxand.docxas binary when reading files so they are returned with base64 encoding instead of text decoding. -
#722
95bb7b9Thanks @aron-cf! - Add named-tunnel support tosandbox.tunnels.get(port, { name }). Named tunnels bind a user-controlled hostname (<name>.<your-zone>) backed by a Cloudflare Tunnel and a proxied CNAME on your zone, so the URL is stable across container restarts and across sandboxes that share the same name. Callingsandbox.destroy()tears down the Cloudflare tunnel and DNS record alongside the container.const tunnel = await sandbox.tunnels.get(8080, { name: 'app' }); console.log(tunnel.url); // → https://app.example.com
@cloudflare/sandbox@0.10.3
Patch Changes
-
#714
0ec4f42Thanks @aron-cf! - Bundlecloudflaredinto the musl/Alpine images. -
#706
ae5f9a1Thanks @scuffi! - Add sessionless execution mode with a configurable default-session policy.Set
enableDefaultSession: falseinSandboxOptionsto run implicit top-level operations without a persistent shell — each command gets a fresh process with no shared state. The option is scoped to the sandbox object returned bygetSandbox(...); explicit per-call session IDs continue to target that session.
@cloudflare/sandbox@0.10.2
Patch Changes
-
#695
c6bf7dcThanks @aron-cf! - Addsandbox.tunnelsnamespace with quick-tunnel support. Callsandbox.tunnels.get(port)to obtain ahttps://<words>.trycloudflare.comURL that proxies tolocalhost:<port>inside the sandbox. The call is idempotent: repeated calls for the same port return the same record from per-sandbox Durable Object storage. No Cloudflare account or DNS setup required.const tunnel = await sandbox.tunnels.get(8080); console.log(tunnel.url); // → https://random-words-here.trycloudflare.com const same = await sandbox.tunnels.get(8080); console.log(same.url === tunnel.url); // true await sandbox.tunnels.list(); await sandbox.tunnels.destroy(8080); // or destroy(tunnel)
-
#691
3ca24fcThanks @scuffi! - Add credential-less R2 bucket mounting via egress interception -
#703
68c8b71Thanks @aron-cf! - Fix inconsistencies in the sandbox.desktop interface between RPC and HTTP transports
@cloudflare/sandbox@0.10.1
Patch Changes
-
#683
718d4e7Thanks @aron-cf! -readFilenow acceptsencoding: 'none'on therpctransport, returning a result whosecontentis aReadableStream<Uint8Array>of raw binary data with no base64 encoding or buffering. Mirrors the existingwriteFilesupport forReadableStreaminput.// Stream a binary file without buffering or base64 overhead (rpc transport only) const { content, size, mimeType } = await sandbox.readFile( '/workspace/image.png', { encoding: 'none' } );
@cloudflare/sandbox@0.10.0
Minor Changes
- #659
7c09e87Thanks @mvanhorn! - Update the default sandbox image runtime from Node.js 20 to Node.js 24 so published images use the current Node.js LTS release. If your workload needs a different Node.js version, build a custom image with theNODE_VERSIONDocker build argument.
Patch Changes
-
#679
21a5a2eThanks @aron-cf! - FixedcreateBackupandrestoreBackupwithlocalBucket: truefailing on therpctransport for archives larger than ~24 MiB. -
#659
7c09e87Thanks @mvanhorn! - AddNODE_VERSIONbuild arg to the Dockerfile, allowing operators to customize the Node.js version used in sandbox container images.
@cloudflare/sandbox@0.9.4
Patch Changes
@cloudflare/sandbox@0.9.3
Patch Changes
-
#666
e8f57c8Thanks @scuffi! - Speed up backup and restore for larger archives with faster default compression, multipart R2 uploads, and parallel range downloads that write directly into the restored archive. -
#647
68c4f9bThanks @aron-cf! - Introduce newrpctransport to consolidatehttpandwebsockettransports.The intention is to replace
httpandwebsockettransports with a single implementation.- No sub-request limitations (currently affects the
httptransport). - No limit on write file size (currently affects both
httpandwebsockettransports).
To enable the transport set
SANDBOX_TRANSPORTtorpcin your wrangler config.A
ReadableStreaminstance can now be passed tosandbox.writeFile()when using therpctransport to avoid the 32mb file limit.{ fetch(req, env) { const sandbox = getSandbox(env.Sandbox, "my-sandbox"); // A ReadableStream can be passed as the content to writeFile(). sandbox.writeFile("/workspace/archive.tar.gz", req.body); return new Response("OK"); } }
- No sub-request limitations (currently affects the
-
#653
e18ba4dThanks @ask-bonk! - Surface s3fs mount failures frommountBucket(). Mount errors (bad credentials, wrong bucket name, network failures) now throwS3FSMountErrorwith the underlyings3fslog output, instead of silently returning success and leaving no filesystem attached.import { S3FSMountError } from '@cloudflare/sandbox'; try { await sandbox.mountBucket('my-bucket', '/mnt/data', { endpoint, credentials }); } catch (err) { if (err instanceof S3FSMountError) { // err.message includes the s3fs log tail, e.g. "403 AccessDenied" } }