> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zap.wzrd.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Cloudflare Sandbox

> Container sandboxes on Cloudflare Workers with backup/restore snapshots and public preview ports.

<img src="https://mintcdn.com/gratitude5dee-zap-56/Y4G9H4edehsua_Ul/images/logos/cloudflare.svg?fit=max&auto=format&n=Y4G9H4edehsua_Ul&q=85&s=df6ca0cda30c00428bf645b2de4ddbe4" alt="Cloudflare" style={{ height: "32px", width: "auto" }} noZoom width="256" height="116" data-path="images/logos/cloudflare.svg" />

First-party adapter over `@cloudflare/sandbox` (`sandbox.cloudflare` plugin).

* Isolation: `container` (Workers container platform).
* Lifecycle: `getSandbox(env.BINDING, id)` → `exec` → `createBackup()` is the snapshot primitive; `restoreBackup(id)` rehydrates a new sandbox from it. No stop/resume in the current SDK surface.
* Ports: `exposePort(port)` returns a public preview URL; no private ports.
* Pinned SDK: `@cloudflare/sandbox@0.4.3`.

```ts theme={null}
import { createCloudflareProvider } from "@wzrdtech/zap-sandbox/adapters/cloudflare";

const provider = createCloudflareProvider({
  binding: "SANDBOX", // wrangler.toml durable-object binding
  getSandbox: wireCloudflareSdk(env),
});
```

`zap doctor` reports `first-party`; `ok: false` without a binding. Live tests require a Cloudflare account and stay opt-in.
