void 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -106
- package/dist/{account-cmd-vJhh5lrb.mjs → account-cmd-CDry3B5V.mjs} +5 -5
- package/dist/{application-analysis-BVsVqc11.mjs → application-analysis-DC2yPvzY.mjs} +1 -1
- package/dist/{application-routing-B7QEjqSR.mjs → application-routing-C9khgLiS.mjs} +1 -1
- package/dist/{auth-DX3JURcX.mjs → auth-B60QDbjg.mjs} +1 -1
- package/dist/{auth-CQkSDS50.mjs → auth-D52yG7hl.mjs} +3 -3
- package/dist/{auth-link-D75t9wO2.mjs → auth-link-DjeOptYi.mjs} +5 -6
- package/dist/{auth-router-ClfhL1J7.mjs → auth-router-BRxIuqDi.mjs} +7 -7
- package/dist/{build-cmd-zMi1iFnS.mjs → build-cmd-Ce3C8huo.mjs} +6 -7
- package/dist/{cache-ZtQmyxVV.mjs → cache-CS8Yxr5a.mjs} +6 -7
- package/dist/{cancel-deploy-Box0kkEV.mjs → cancel-deploy-mZsD88Xa.mjs} +4 -6
- package/dist/{cf-access-BGe5sWXF.mjs → cf-access-YTlqvAsk.mjs} +1 -1
- package/dist/cf-build-output-ChY6-XWP.mjs +2 -0
- package/dist/cli/cli.mjs +45 -45
- package/dist/cli/cloudflare-operation-process.mjs +3 -3
- package/dist/cli/env-schema-probe.d.mts +1 -1
- package/dist/cli/env-schema-probe.mjs +2 -2
- package/dist/client-BxVixJBI.mjs +2 -0
- package/dist/{client-DKAsFA4X.mjs → client-mC-dFGDD.mjs} +103 -25
- package/dist/{cloudflare-cmd-CmY8dGkd.mjs → cloudflare-cmd-bhwCxAN6.mjs} +2 -2
- package/dist/{cloudflare-connect-IiR3ZieC.mjs → cloudflare-connect-CuhRgk3k.mjs} +2 -2
- package/dist/{cloudflare-operations-DzH-A966.mjs → cloudflare-operations-DYa3coIk.mjs} +2 -2
- package/dist/{cloudflare-operations-BCdXSsmo.mjs → cloudflare-operations-DoQrVHAt.mjs} +1 -1
- package/dist/{connect-B-usTnlF.mjs → connect-H6EvP62X.mjs} +12 -9
- package/dist/{create-project-CYOOAYcn.mjs → create-project-B2kk9Q0o.mjs} +6 -6
- package/dist/{create-project-FWbf5Olo.mjs → create-project-Dbb4uiN-.mjs} +1 -1
- package/dist/{db-Ck2eZ2iB.mjs → db-DpCKZto0.mjs} +35 -38
- package/dist/{delete-sK56qtzZ.mjs → delete-CxlSvsvW.mjs} +6 -7
- package/dist/{deploy-gCVaiJbS.mjs → deploy-CeEbnv4b.mjs} +9249 -8925
- package/dist/deploy-qmiLE1G1.mjs +2 -0
- package/dist/{dev-inbox-P0u4tM8Y.mjs → dev-inbox-D64ZKUod.mjs} +5 -6
- package/dist/{domain-DFfQE8jg.mjs → domain-B_9VgOm6.mjs} +8 -8
- package/dist/{email-CdnhUHvJ.mjs → email-BokHgjKj.mjs} +7 -7
- package/dist/{env-DmGdHi5i.mjs → env-BdTc-K2L.mjs} +7 -8
- package/dist/{env-public-BX_r8HR6.d.mts → env-public-DR7ZM6d-.d.mts} +1 -1
- package/dist/{env-validation-zZOCcQVZ.mjs → env-validation-cZBvGWaP.mjs} +1 -1
- package/dist/{fetch-stream-IvCYKyQL.mjs → fetch-stream-Nm3hkZbT.mjs} +8 -1
- package/dist/{gen-CshAkukR.mjs → gen-BhDlTpwW.mjs} +2 -4
- package/dist/gen-qCBwH3fZ.mjs +2 -0
- package/dist/{github-cmd-DftuEvIt.mjs → github-cmd-hhkTzlGS.mjs} +7 -16
- package/dist/{handler-CZ4nAylQ.d.mts → handler-BeK3weD4.d.mts} +1 -1
- package/dist/{help-Dotbf6iz.mjs → help-Bv44e2tm.mjs} +13 -9
- package/dist/help-Dw5f9Xrg.mjs +2 -0
- package/dist/index.d.mts +19 -15
- package/dist/index.mjs +2225 -2142
- package/dist/{info-B97bTX9N.mjs → info-DhtTKh65.mjs} +2 -4
- package/dist/{init-BTQEZZGJ.mjs → init-BMf4T03q.mjs} +17 -18
- package/dist/{limits-Bq5LG8Id.d.mts → limits-CFsDKQvU.d.mts} +1 -10
- package/dist/{limits-Cjuk2VPm.mjs → limits-D0vD1M9A.mjs} +1 -22
- package/dist/{link-B46sYH0K.mjs → link-BqYsSS_I.mjs} +6 -7
- package/dist/{list-BnPrIsU_.mjs → list-_kBToO-l.mjs} +10 -10
- package/dist/{live-Chw1eIMv.d.mts → live-iAuEH1hd.d.mts} +1 -1
- package/dist/{local-d1-2CMnpuW_.mjs → local-d1-fGxYrVD6.mjs} +2 -2
- package/dist/login-D7meQg_3.mjs +2 -0
- package/dist/{login-BuiMyUrx.mjs → login-DFuo-RWO.mjs} +9 -7
- package/dist/{logs-CZG9d-ic.mjs → logs-DYgnh6dH.mjs} +7 -8
- package/dist/migrate-CEu2X5DB.mjs +2 -0
- package/dist/{migrate-q4_njtaW.mjs → migrate-CV1on-yJ.mjs} +2 -4
- package/dist/{node-BkyRWRx8.mjs → node-C6Q6e1Es.mjs} +1 -1
- package/dist/{operator-args-B3BTmSoi.mjs → operator-args-DdY54Bgb.mjs} +1 -1
- package/dist/{operator-auth-7erYc6Lt.mjs → operator-auth-2dsGlTT5.mjs} +4 -8
- package/dist/{operator-client-CpHjTd0t.mjs → operator-client-BFqpp6z0.mjs} +3 -3
- package/dist/{operator-cmd-DGqPJUD3.mjs → operator-cmd-CUGHXrQf.mjs} +27 -9
- package/dist/operator-cmd-DRPvhpjM.mjs +2 -0
- package/dist/{output-CbM85T4k.mjs → output-BvdaehtE.mjs} +28 -4
- package/dist/pages/client.d.mts +4 -1
- package/dist/pages/client.mjs +120 -29
- package/dist/pages/index.mjs +1 -1
- package/dist/pages/islands-plugin.mjs +1 -1
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/{plan-NPpwZ_kc.mjs → plan-CJGEeTEI.mjs} +2 -2
- package/dist/plan-COtUvdMA.mjs +2 -0
- package/dist/{platform-args-3k8X9-H_.mjs → platform-args-DSV2p4nY.mjs} +4 -2
- package/dist/platform-args-Dcy_5b_Y.mjs +2 -0
- package/dist/{platform-auth-config-DDrxUy4m.mjs → platform-auth-config-Bosx7U1h.mjs} +20 -19
- package/dist/{platform-auth-protection-BLadnnct.mjs → platform-auth-protection-DcbL_LW_.mjs} +8 -8
- package/dist/{platform-auth-recovery-CmCzX2Fl.mjs → platform-auth-recovery-WfTZ8K6o.mjs} +7 -7
- package/dist/{platform-cmd-DMDEc9uS.mjs → platform-cmd-DbKtQb_4.mjs} +73 -38
- package/dist/{platform-cmd-pMTRhvYs.mjs → platform-cmd-dyFUof0t.mjs} +1 -1
- package/dist/platform-discovery-BC0HCKYt.mjs +41 -0
- package/dist/{platform-domain-Di6EYrQl.mjs → platform-domain-Bsq43AJp.mjs} +5 -4
- package/dist/{platform-lifecycle-BFdSi9Qt.mjs → platform-lifecycle--5gWmDoI.mjs} +1 -1
- package/dist/{platform-lifecycle-BBoNzojY.mjs → platform-lifecycle-Cfi0o6xM.mjs} +4605 -3527
- package/dist/platform-management-Bbwf6-Dq.mjs +2 -0
- package/dist/{platform-management-CWOQOWXm.mjs → platform-management-BrF9STZp.mjs} +211 -31
- package/dist/{platform-plans-config-Vl9BP3H4.mjs → platform-plans-config-DU-8nC2Y.mjs} +3 -3
- package/dist/{platform-recovery-BJnQJEtQ.mjs → platform-recovery-DQAqAQYu.mjs} +3 -3
- package/dist/{platform-registry-DkPPXfp_.mjs → platform-registry-P387v42A.mjs} +18 -11
- package/dist/prepare-BBknoZI1.mjs +2 -0
- package/dist/{prepare-CBLT3CHH.mjs → prepare-BMrRWLwP.mjs} +3 -4
- package/dist/{prepare-DnaKBi--.mjs → prepare-WoUubFKL.mjs} +1 -1
- package/dist/{project-DsblYifa.mjs → project-BiaPQ7ur.mjs} +1 -1
- package/dist/{project-DKG5Ra8p.mjs → project-DQstYTxO.mjs} +1 -1
- package/dist/{project-cmd-DxnXstAq.mjs → project-cmd-BbH2LptN.mjs} +21 -22
- package/dist/{project-team-BmHcaALJ.mjs → project-team-Yiww3-go.mjs} +8 -9
- package/dist/{project-token-GionZlBI.mjs → project-token-BrtT2NkY.mjs} +6 -9
- package/dist/{project-zero-trust-JLCjVQA7.mjs → project-zero-trust-nYJ2V2nc.mjs} +5 -6
- package/dist/{prompts-BNUoTiaf.mjs → prompts-6OSVA7DJ.mjs} +58 -15
- package/dist/{prompts-2TGE6oXx.mjs → prompts-ZAuJlyCj.mjs} +1 -1
- package/dist/{protocol-CjF_iI9X.d.mts → protocol-BX8t2jiw.d.mts} +1 -1
- package/dist/{provision-CVku1JFU.mjs → provision-DMTPG8Rh.mjs} +1 -1
- package/dist/{provision-CaoxO_U7.mjs → provision-VeqAC77A.mjs} +18 -8
- package/dist/{requests-BOjIVAeF.mjs → requests-TIz_jtSu.mjs} +5 -6
- package/dist/{rollback-CwR3pLj3.mjs → rollback-dBqICPzj.mjs} +9 -10
- package/dist/{runner-Ol0TNjk6.mjs → runner--2KF6Kua.mjs} +1 -1
- package/dist/{runner-CXA9Fh8h.mjs → runner-voIltZrY.mjs} +1 -1
- package/dist/runtime/ai.d.mts +10 -11
- package/dist/runtime/ai.mjs +13 -18
- package/dist/runtime/client-react.mjs +1 -1
- package/dist/runtime/client-solid.mjs +1 -1
- package/dist/runtime/client-svelte.mjs +1 -1
- package/dist/runtime/client-vue.mjs +1 -1
- package/dist/runtime/client.mjs +1 -1
- package/dist/runtime/email/testing.mjs +1 -1
- package/dist/runtime/email.mjs +35 -17
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/limits.d.mts +2 -2
- package/dist/runtime/limits.mjs +2 -2
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/migration-handler.mjs +33 -7
- package/dist/runtime/routing.d.mts +1 -1
- package/dist/runtime/routing.mjs +1 -1
- package/dist/runtime/sandbox.d.mts +1 -1
- package/dist/runtime/sandbox.mjs +12 -22
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +1 -1
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/{sandbox-XZAqzFlG.d.mts → sandbox-C5LFoJMf.d.mts} +7 -7
- package/dist/{scan-C7okrLyM.mjs → scan-C8dA7iM4.mjs} +10 -6
- package/dist/{secret-ByWJWBUG.mjs → secret-AKnNXNP5.mjs} +15 -16
- package/dist/{skills-C1PlclPt.mjs → skills-BPQUGClu.mjs} +1 -1
- package/dist/{subcommand-prompt-klFCfcor.mjs → subcommand-prompt-B6WS9Aoz.mjs} +2 -2
- package/dist/sveltekit.d.mts +1 -1
- package/dist/sveltekit.mjs +4 -9
- package/dist/validate-pna7R3Pv.mjs +2 -0
- package/dist/{validate-ctOrgiS3.mjs → validate-ymhap6M_.mjs} +1 -1
- package/dist/{wrangler-7K-bW_DL.mjs → wrangler-DhUerFkW.mjs} +10 -15
- package/dist/{ws-CL1w7GXU.d.mts → ws-C79j4aED.d.mts} +1 -1
- package/package.json +21 -21
- package/sandbox.Dockerfile +1 -1
- package/skills/void/SKILL.md +5 -2
- package/skills/void/docs/guide/ai.md +78 -137
- package/skills/void/docs/guide/app-types.md +1 -1
- package/skills/void/docs/guide/auth.md +0 -2
- package/skills/void/docs/guide/database/d1.md +7 -7
- package/skills/void/docs/guide/database.md +15 -0
- package/skills/void/docs/guide/deployment.md +58 -124
- package/skills/void/docs/guide/env-vars.md +1 -5
- package/skills/void/docs/guide/index.md +19 -18
- package/skills/void/docs/guide/kv.md +0 -2
- package/skills/void/docs/guide/live.md +2 -0
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +49 -47
- package/skills/void/docs/guide/pages-routing/overview.md +2 -2
- package/skills/void/docs/guide/platform/administration/email.md +0 -2
- package/skills/void/docs/guide/platform/administration/operations.md +11 -22
- package/skills/void/docs/guide/platform/administration/plans.md +1 -5
- package/skills/void/docs/guide/platform/administration/zero-trust.md +1 -4
- package/skills/void/docs/guide/platform/development/schema-ci.md +7 -1
- package/skills/void/docs/guide/platform/installation/credentials.md +2 -2
- package/skills/void/docs/guide/platform/installation/first-deployment.md +5 -1
- package/skills/void/docs/guide/platform/installation/maintenance.md +33 -11
- package/skills/void/docs/guide/platform/installation/prerequisites.md +79 -7
- package/skills/void/docs/guide/platform/installation/setup.md +1 -1
- package/skills/void/docs/guide/platform/installation/uninstall.md +44 -11
- package/skills/void/docs/guide/quickstart.md +37 -80
- package/skills/void/docs/guide/sandboxes.md +75 -66
- package/skills/void/docs/guide/self-hosted-platform.md +20 -0
- package/skills/void/docs/guide/websockets.md +0 -2
- package/skills/void/docs/integrations/frameworks/overview.md +2 -2
- package/skills/void/docs/integrations/frameworks/sveltekit.md +40 -25
- package/skills/void/docs/integrations/nodejs-bun-deno.md +7 -2
- package/skills/void/docs/reference/api/resources.md +38 -14
- package/skills/void/docs/reference/api.md +35 -34
- package/skills/void/docs/reference/cli/auth.md +3 -1
- package/skills/void/docs/reference/cli/deploy.md +1 -1
- package/skills/void/docs/reference/cli/platform-config.md +2 -2
- package/skills/void/docs/reference/cli/platform-installation.md +14 -12
- package/skills/void/docs/reference/cli/platform-operations.md +4 -8
- package/skills/void/docs/reference/cli/platform.md +9 -2
- package/skills/void/docs/reference/cli.md +1 -1
- package/skills/void/docs/reference/resource-inference.md +12 -8
- package/dist/cf-build-output-_0HNWysu.mjs +0 -2
- package/dist/client-B9UBI03V.mjs +0 -2
- package/dist/deploy-irP5q0-x.mjs +0 -2
- package/dist/gen-DvQTWzDU.mjs +0 -2
- package/dist/help-mabuIV98.mjs +0 -2
- package/dist/login-DIy9Sb-U.mjs +0 -2
- package/dist/migrate-BCiJ8w0f.mjs +0 -2
- package/dist/plan-D1Q5rf-r.mjs +0 -2
- package/dist/platform-args-DdnM6WIf.mjs +0 -2
- package/dist/platform-management-DG47jys8.mjs +0 -2
- package/dist/prepare-CnjcTV2s.mjs +0 -2
- package/dist/validate-Dq_L3s0S.mjs +0 -2
- package/skills/void/docs/guide/env-migration.md +0 -109
- package/dist/{cf-build-output-BPqOT964.mjs → cf-build-output-U8o1Gl6X.mjs} +1 -1
- package/dist/{env-validation-C_8tPdhs.mjs → env-validation-vBSQ8gw5.mjs} +1 -1
|
@@ -6,63 +6,27 @@ outline: deep
|
|
|
6
6
|
|
|
7
7
|
Use a Cloudflare Sandbox to run commands, work with files, and connect to servers from server code. Each Sandbox ID selects an isolated container.
|
|
8
8
|
|
|
9
|
+
## Requirements
|
|
10
|
+
|
|
11
|
+
Cloudflare deployments require [Workers Paid](https://dash.cloudflare.com/?to=/:account/workers/plans) and Containers access. Run Docker for local development and direct deployments that build an image. A team platform's runtime token needs Account / Containers: Edit and Account / Cloudchamber: Edit.
|
|
12
|
+
|
|
13
|
+
## Run a command
|
|
14
|
+
|
|
9
15
|
```ts
|
|
10
16
|
import { defineHandler } from 'void';
|
|
11
17
|
import { getSandbox } from 'void/sandbox';
|
|
12
18
|
|
|
13
19
|
export const POST = defineHandler(async (c) => {
|
|
14
20
|
const sandbox = await getSandbox('default');
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
stdout: new TextDecoder().decode(result.stdout),
|
|
20
|
-
}),
|
|
21
|
-
limited: (limit) => limit.response({ message: 'Execution is temporarily unavailable.' }),
|
|
21
|
+
const result = await sandbox.run(['node', '--version']);
|
|
22
|
+
return c.json({
|
|
23
|
+
exitCode: result.exitCode,
|
|
24
|
+
stdout: new TextDecoder().decode(result.stdout),
|
|
22
25
|
});
|
|
23
26
|
});
|
|
24
27
|
```
|
|
25
28
|
|
|
26
|
-
Importing from `void/sandbox` enables the required resources. Local development,
|
|
27
|
-
|
|
28
|
-
## Configuration
|
|
29
|
-
|
|
30
|
-
The default environment provides Node.js 24 on Debian Trixie. Local development and native deploys need Docker running. Managed platform deploys use Cloudflare's managed Node.js image.
|
|
31
|
-
|
|
32
|
-
Use `void.config.ts` when you need a custom image or container size:
|
|
33
|
-
|
|
34
|
-
```ts
|
|
35
|
-
import { defineConfig } from 'void/config';
|
|
36
|
-
|
|
37
|
-
export default defineConfig({
|
|
38
|
-
sandbox: {
|
|
39
|
-
image: './Dockerfile.sandbox',
|
|
40
|
-
platformImage: 'registry.cloudflare.com/<account-id>/sandbox@sha256:<digest>',
|
|
41
|
-
instanceType: 'standard-1',
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
| Field | Default | Description |
|
|
47
|
-
| ------------------- | --------------------------- | -------------------------------------------------------------------- |
|
|
48
|
-
| `binding` | `SANDBOX` | Binding name for local and native Cloudflare use |
|
|
49
|
-
| `className` | `SandboxV1` | Durable Object class for local and native Cloudflare use |
|
|
50
|
-
| `containerName` | `void-sandbox-v1` | Cloudflare container application name |
|
|
51
|
-
| `image` | Packaged Node.js Dockerfile | Dockerfile or digest-pinned Cloudflare registry image for native use |
|
|
52
|
-
| `imageBuildContext` | Directory of `image` | Docker build context |
|
|
53
|
-
| `platformImage` | `cloudflare/debian-trixie` | Image used by managed platform deploys |
|
|
54
|
-
| `instanceType` | `lite` | `lite`, `standard-1`, `standard-2`, `standard-3`, or `standard-4` |
|
|
55
|
-
|
|
56
|
-
Custom images must include the helper matching Void's installed Sandbox SDK version. The SDK image supplies this binary, but is not a runnable environment itself:
|
|
57
|
-
|
|
58
|
-
```dockerfile
|
|
59
|
-
FROM node:24.21.0-trixie-slim
|
|
60
|
-
COPY --from=docker.io/cloudflare/sandbox:1.0.0 /usr/local/bin/sandbox-shim /usr/local/bin/sandbox-shim
|
|
61
|
-
WORKDIR /workspace
|
|
62
|
-
CMD ["sleep", "infinity"]
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
For a managed platform, push your custom image to that platform account's Cloudflare registry and set `platformImage` to its digest-pinned reference. If `image` is already a Cloudflare registry reference, it also becomes the default `platformImage`. External registries and mutable tags are not supported. See [Cloudflare's image management guide](https://developers.cloudflare.com/containers/guides/image-management/#push-images-to-the-cloudflare-registry).
|
|
29
|
+
Importing from `void/sandbox` enables the required resources. Local development, direct Cloudflare deployments, and team platforms share the same runtime API.
|
|
66
30
|
|
|
67
31
|
## Runtime API
|
|
68
32
|
|
|
@@ -75,33 +39,55 @@ const sandbox = await getSandbox(`user-${user.id}`, {
|
|
|
75
39
|
inactivityTimeoutMs: 10 * 60 * 1000,
|
|
76
40
|
enableInternet: false,
|
|
77
41
|
});
|
|
78
|
-
const
|
|
79
|
-
.
|
|
80
|
-
|
|
81
|
-
})
|
|
82
|
-
.match({
|
|
83
|
-
ok: (result) => Response.json({ exitCode: result.exitCode }),
|
|
84
|
-
limited: (limit) => limit.response(),
|
|
85
|
-
});
|
|
42
|
+
const result = await sandbox.run(['node', '--version'], {
|
|
43
|
+
signal: AbortSignal.timeout(5_000),
|
|
44
|
+
});
|
|
86
45
|
```
|
|
87
46
|
|
|
88
47
|
Commands take an executable and arguments as an array. For shell syntax, explicitly run `['sh', '-c', command]`. Execution options include `cwd` (default `/workspace`), `env`, `user`, `signal`, `pty`, `stdin`, `stdout`, and `stderr`.
|
|
89
48
|
|
|
90
|
-
`run()`
|
|
49
|
+
Sandbox operations return promises. `run()` resolves with `stdout` and `stderr` as `ArrayBuffer`s and the command's exit code. Usage limits reject with [`UsageLimit`](#usage-limits); other failures reject normally.
|
|
91
50
|
|
|
92
|
-
`exec()`
|
|
51
|
+
`exec()` resolves with a process. Await `process.output()` to collect its output and exit code, or read the streams and await `process.exitCode`. Waiting for completion keeps a long command active during pauses in its output; unattended background commands can stop when the Sandbox becomes idle. A runtime limit can reject completion after a command has successfully started.
|
|
93
52
|
|
|
94
53
|
Use `stdin: 'pipe'` for a writable input stream. `kill(signal?)` stops a process, and `resize(cols, rows)` resizes its terminal.
|
|
95
54
|
|
|
96
|
-
File operations live under `sandbox.files`: `readFile`, `writeFile`, `stat`, `lstat`, `readDirectory`, `mkdir`, `rename`, and `remove`.
|
|
55
|
+
File operations live under `sandbox.files`: `readFile`, `writeFile`, `stat`, `lstat`, `readDirectory`, `mkdir`, `rename`, and `remove`. Await `readFile()` to receive a streaming `Response`, then use `.text()`, `.arrayBuffer()`, or `.body`. `writeFile()` accepts text, binary data, or a byte stream. Relative file paths require an explicit `cwd` option.
|
|
97
56
|
|
|
98
|
-
To reach a server inside the container,
|
|
57
|
+
To reach a server inside the container, await `sandbox.fetch(port, new Request(url))`. `sandbox.running()` checks whether the container is running; `sandbox.destroy()` stops it.
|
|
99
58
|
|
|
100
59
|
`getSandbox()` options include `inactivityTimeoutMs` (default ten minutes, maximum six hours), `enableInternet` (default `false`), and string `labels`. Internet access and labels take effect on the next container start. `binding` selects a custom native binding; managed platforms use the configured binding.
|
|
101
60
|
|
|
102
61
|
For code that runs on both deployment targets, use `getSandbox()`. Direct access through `c.env.SANDBOX` is available only on local and native Cloudflare deployments.
|
|
103
62
|
|
|
104
|
-
|
|
63
|
+
## Usage limits
|
|
64
|
+
|
|
65
|
+
Sandbox limits reject with `SandboxLimitError`, which extends `UsageLimit` from `void/limits`. The error includes `resource: 'sandbox'` and a `reason` of `concurrency` or `runtime_budget`. Void route handlers and Pages actions automatically send a structured HTTP 429 when the error is left uncaught.
|
|
66
|
+
|
|
67
|
+
Use `instanceof UsageLimit` to optionally handle both AI and Sandbox limits, or `instanceof SandboxLimitError` for Sandbox-specific handling:
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
import { defineHandler } from 'void';
|
|
71
|
+
import { UsageLimit } from 'void/limits';
|
|
72
|
+
import { getSandbox } from 'void/sandbox';
|
|
73
|
+
|
|
74
|
+
export const POST = defineHandler(async (c) => {
|
|
75
|
+
const sandbox = await getSandbox('default');
|
|
76
|
+
try {
|
|
77
|
+
const result = await sandbox.run(['node', 'task.mjs']);
|
|
78
|
+
return c.json({ exitCode: result.exitCode });
|
|
79
|
+
} catch (error) {
|
|
80
|
+
if (error instanceof UsageLimit) {
|
|
81
|
+
return error.response({
|
|
82
|
+
message: 'Execution is temporarily unavailable. Try again shortly.',
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
throw error;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Keep user input available so it can be retried. Checking `running()`, stopping a process, and `destroy()` remain available after a usage limit.
|
|
105
91
|
|
|
106
92
|
## State persistence
|
|
107
93
|
|
|
@@ -109,14 +95,37 @@ The `limited` handler receives `resource: 'sandbox'`, a `reason` of `concurrency
|
|
|
109
95
|
|
|
110
96
|
Files, running processes, and listening servers last only as long as the container. It can stop after inactivity, crash, or restart. Save anything you need to keep in your database, KV, or R2. Deleting a project on a Void platform removes both its Durable Objects and containers.
|
|
111
97
|
|
|
112
|
-
##
|
|
98
|
+
## Configuration
|
|
99
|
+
|
|
100
|
+
The default environment provides Node.js 24 on Debian Trixie. Managed platform deploys use Cloudflare's managed Node.js image.
|
|
101
|
+
|
|
102
|
+
Use `void.config.ts` when you need a custom image or container size:
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
import { defineConfig } from 'void/config';
|
|
106
|
+
|
|
107
|
+
export default defineConfig({
|
|
108
|
+
sandbox: {
|
|
109
|
+
image: './Dockerfile.sandbox',
|
|
110
|
+
platformImage: 'registry.cloudflare.com/<account-id>/sandbox@sha256:<digest>',
|
|
111
|
+
instanceType: 'standard-1',
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
See the [configuration reference](../reference/config.md#sandbox) for binding names, image settings, and container sizes.
|
|
113
117
|
|
|
114
|
-
|
|
118
|
+
Custom images must include the helper matching Void's installed Sandbox SDK version. The SDK image supplies this binary, but is not a runnable environment itself:
|
|
115
119
|
|
|
116
|
-
|
|
120
|
+
```dockerfile
|
|
121
|
+
FROM node:24.21.0-trixie-slim
|
|
122
|
+
COPY --from=docker.io/cloudflare/sandbox:1.0.0 /usr/local/bin/sandbox-shim /usr/local/bin/sandbox-shim
|
|
123
|
+
WORKDIR /workspace
|
|
124
|
+
CMD ["sleep", "infinity"]
|
|
125
|
+
```
|
|
117
126
|
|
|
118
|
-
|
|
127
|
+
For a managed platform, push your custom image to that platform account's Cloudflare registry and set `platformImage` to its digest-pinned reference. If `image` is already a Cloudflare registry reference, it also becomes the default `platformImage`. External registries and mutable tags are not supported. See [Cloudflare's image management guide](https://developers.cloudflare.com/containers/guides/image-management/#push-images-to-the-cloudflare-registry).
|
|
119
128
|
|
|
120
|
-
|
|
129
|
+
## Deployment
|
|
121
130
|
|
|
122
|
-
|
|
131
|
+
`void deploy --platform cloudflare` builds native images and deploys the Sandbox alongside the application. `void deploy` on a connected Void Platform applies the platform's Sandbox concurrency and runtime limits.
|
|
@@ -12,6 +12,26 @@ The core platform supports GitHub, Google, generic OIDC, and Cloudflare Access l
|
|
|
12
12
|
|
|
13
13
|
The core installation includes managed Sandboxes and an email gateway; email is enabled when you configure a shared mail domain and zone. The user dashboard, GitHub builds and webhooks, build Containers, and custom project domains aren't part of the core installation. Source-built platforms that add the optional GitHub services should follow the [isolated webhook ingress setup](/guide/platform/development/runtime#optional-github-webhook-ingress-for-access-protected-apis) when Access protects the API.
|
|
14
14
|
|
|
15
|
+
## Deployment features
|
|
16
|
+
|
|
17
|
+
Both targets use the same application APIs. A core platform adds shared access and retained deployment history:
|
|
18
|
+
|
|
19
|
+
| Feature | Direct Cloudflare | Core self-hosted platform |
|
|
20
|
+
| ------------------------------------------------ | -------------------------------- | --------------------------------------------- |
|
|
21
|
+
| Static sites, SPAs, and native Pages SSR | Supported | Supported |
|
|
22
|
+
| Routing rules, WebSockets, queues, cron, and ISR | Supported | Supported |
|
|
23
|
+
| D1, KV, R2, and external SQL through Hyperdrive | Supported | Supported |
|
|
24
|
+
| Workers AI and provider requests | Your account and gateway | Installation gateway and proxy |
|
|
25
|
+
| Runtime logs | Live Cloudflare tail | Retained platform logs |
|
|
26
|
+
| Application rollback | Worker versions | Retained platform deployments |
|
|
27
|
+
| Typed Durable State | Supported | Unavailable |
|
|
28
|
+
| Sandboxes | Requires Workers Paid and Docker | Requires Workers Paid on the platform account |
|
|
29
|
+
| Custom application domains | Supported | Unavailable in the core installation |
|
|
30
|
+
| Generated GitHub deployment workflow | Supported | Use your CI with a scoped developer token |
|
|
31
|
+
| User dashboard and managed GitHub builds | Not required | Not included in a standard installation |
|
|
32
|
+
|
|
33
|
+
A team platform requires Workers for Platforms and the [documented infrastructure](/guide/platform/installation/domains#cloudflare-footprint). Features depend on the installation's configuration.
|
|
34
|
+
|
|
15
35
|
## Installation Guides
|
|
16
36
|
|
|
17
37
|
- [Prerequisites](/guide/platform/installation/prerequisites)
|
|
@@ -202,8 +202,6 @@ Both `defineRoom()` and `defineWebSocket()` accept optional `name`. Use a static
|
|
|
202
202
|
|
|
203
203
|
By default, the instance key includes parameter names. `/chat/:room` with `room: 'general'` uses `room=general`; a route without parameters uses `default`. Multiple parameters are joined in route order, for example `team=acme&room=general`. If a multi-parameter route has a value containing `&`, its key uses a versioned encoding to keep rooms separate.
|
|
204
204
|
|
|
205
|
-
When upgrading an existing multi-parameter route with `&` in its parameter values, those rooms start with isolated storage. The previous storage is retained, but may have been shared by multiple rooms. Migrate only data whose ownership you have verified into each new room. Single-parameter rooms and multi-parameter rooms without `&` keep their existing identities.
|
|
206
|
-
|
|
207
205
|
If you also rename `[room]` to `[id]`, preserve the old key explicitly:
|
|
208
206
|
|
|
209
207
|
```ts
|
|
@@ -36,11 +36,11 @@ With `voidPlugin()` added to the framework's Vite config, frameworks get most of
|
|
|
36
36
|
- **Auth:** Void-managed auth is not supported in framework mode yet. For now, use Better Auth's official integration for your framework.
|
|
37
37
|
- **Cron jobs:** scheduled handlers via the `crons/` directory.
|
|
38
38
|
- **Queue consumers:** typed producers and consumers via the `queues/` directory.
|
|
39
|
-
- **Revalidation and prerendering:** configure them with [`routing.revalidate`](../../guide/edge/revalidation.md) and [`routing.prerender`](../../guide/edge/prerendering.md) in `void.config.ts`. Void apps can also set these per page in
|
|
39
|
+
- **Revalidation and prerendering:** configure them with [`routing.revalidate`](../../guide/edge/revalidation.md) and [`routing.prerender`](../../guide/edge/prerendering.md) in `void.config.ts`. Void apps can also set these per page in companion `.server.ts` files.
|
|
40
40
|
|
|
41
41
|
For framework apps, Void revalidation caches public HTML document responses with both `void deploy` and `void deploy --platform cloudflare`. Client data requests continue to use the framework's own behavior. A response with `Set-Cookie` or `Cache-Control: private`, `no-store`, or `no-cache` is never shared.
|
|
42
42
|
|
|
43
|
-
Frameworks can also access bindings directly via the framework's own mechanisms (e.g. `platform.env` in SvelteKit, `event.context.cloudflare.env` in Nuxt, `
|
|
43
|
+
Frameworks can also access bindings directly via the framework's own mechanisms (e.g. `env` from `cloudflare:workers` in SvelteKit 3 and Analog, `platform.env` in SvelteKit 2, `event.context.cloudflare.env` in Nuxt, `Astro.locals.runtime.env` in Astro).
|
|
44
44
|
|
|
45
45
|
## Configuration
|
|
46
46
|
|
|
@@ -6,6 +6,8 @@ outline: deep
|
|
|
6
6
|
|
|
7
7
|
Use Void with [SvelteKit](https://svelte.dev/docs/kit) for resource detection, typed database queries, and migrations. SvelteKit keeps its own build and Cloudflare integration; Void plugs into its Vite configuration.
|
|
8
8
|
|
|
9
|
+
Void supports SvelteKit 3 and SvelteKit 2.62 or later. The setup below uses SvelteKit 3 with `@sveltejs/adapter-cloudflare` 8.
|
|
10
|
+
|
|
9
11
|
## Setup
|
|
10
12
|
|
|
11
13
|
### 1. Create a new project
|
|
@@ -27,10 +29,8 @@ npm install -D @sveltejs/adapter-cloudflare void
|
|
|
27
29
|
import adapter from '@sveltejs/adapter-cloudflare';
|
|
28
30
|
import { sveltekit } from '@sveltejs/kit/vite';
|
|
29
31
|
import { voidPlugin } from 'void';
|
|
30
|
-
import { withVoidTSConfig } from 'void/sveltekit';
|
|
31
|
-
import { defineConfig } from 'vite';
|
|
32
32
|
|
|
33
|
-
export default
|
|
33
|
+
export default {
|
|
34
34
|
plugins: [
|
|
35
35
|
voidPlugin(),
|
|
36
36
|
sveltekit({
|
|
@@ -38,16 +38,11 @@ export default defineConfig({
|
|
|
38
38
|
config: './.void-wrangler.jsonc',
|
|
39
39
|
platformProxy: { configPath: './.void-wrangler.jsonc' },
|
|
40
40
|
}),
|
|
41
|
-
typescript: {
|
|
42
|
-
config: withVoidTSConfig(),
|
|
43
|
-
},
|
|
44
41
|
}),
|
|
45
42
|
],
|
|
46
|
-
}
|
|
43
|
+
};
|
|
47
44
|
```
|
|
48
45
|
|
|
49
|
-
If your project already configures SvelteKit in `svelte.config.js`, keep that file and add `typescript.config: withVoidTSConfig()` under its `kit` options instead. SvelteKit ignores `svelte.config.js` when options are passed directly to `sveltekit()`.
|
|
50
|
-
|
|
51
46
|
### 4. Create `void.config.ts`
|
|
52
47
|
|
|
53
48
|
Point SvelteKit's adapter at Void's generated Cloudflare config as shown above. Add your Cloudflare settings to `void.config.ts`:
|
|
@@ -66,20 +61,19 @@ export default defineConfig({
|
|
|
66
61
|
|
|
67
62
|
### 5. Configure `tsconfig.json`
|
|
68
63
|
|
|
69
|
-
Extend SvelteKit’s generated config
|
|
70
|
-
|
|
71
|
-
Keep `compilerOptions.paths` out of the root config so it does not override SvelteKit’s aliases.
|
|
64
|
+
Extend SvelteKit’s generated config and Void’s generated types and database aliases:
|
|
72
65
|
|
|
73
66
|
```json
|
|
74
67
|
{
|
|
75
|
-
"extends": "./.
|
|
68
|
+
"extends": ["$app/tsconfig", "./.void/tsconfig.json"],
|
|
76
69
|
"compilerOptions": {
|
|
77
|
-
"types": ["void/env"]
|
|
78
|
-
}
|
|
70
|
+
"types": ["$app/types", "void/env"]
|
|
71
|
+
},
|
|
72
|
+
"include": ["src", "db", "crons", "queues", "*.ts"]
|
|
79
73
|
}
|
|
80
74
|
```
|
|
81
75
|
|
|
82
|
-
Run `void prepare` after a fresh clone or before typechecking in CI so `.void/tsconfig.json` exists before SvelteKit syncs its config.
|
|
76
|
+
Run `void prepare` after a fresh clone or before typechecking in CI so `.void/tsconfig.json` exists before SvelteKit syncs its config. Use `package.json` subpath imports for aliases such as SvelteKit 3's `#lib`.
|
|
83
77
|
|
|
84
78
|
### 6. Deploy
|
|
85
79
|
|
|
@@ -116,20 +110,41 @@ Declare variables in `env.ts` and read them with `import { env } from "void/env"
|
|
|
116
110
|
|
|
117
111
|
## Accessing Bindings Directly
|
|
118
112
|
|
|
119
|
-
|
|
113
|
+
In SvelteKit 3, use the `cloudflare:workers` module in server-side code:
|
|
120
114
|
|
|
121
115
|
```ts
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
return { users: results };
|
|
126
|
-
}
|
|
116
|
+
import { env } from 'cloudflare:workers';
|
|
117
|
+
|
|
118
|
+
const { results } = await env.DB.prepare('SELECT * FROM users').all();
|
|
127
119
|
```
|
|
128
120
|
|
|
129
|
-
|
|
121
|
+
## Existing SvelteKit 2 apps
|
|
122
|
+
|
|
123
|
+
Use SvelteKit 2.62 or later with `@sveltejs/adapter-cloudflare` 7. The Vite configuration above also works with Kit 2; add Void's tsconfig hook to the `sveltekit()` options:
|
|
130
124
|
|
|
131
125
|
```ts
|
|
132
|
-
import {
|
|
126
|
+
import { withVoidTSConfig } from 'void/sveltekit';
|
|
133
127
|
|
|
134
|
-
|
|
128
|
+
sveltekit({
|
|
129
|
+
adapter: adapter({
|
|
130
|
+
config: './.void-wrangler.jsonc',
|
|
131
|
+
platformProxy: { configPath: './.void-wrangler.jsonc' },
|
|
132
|
+
}),
|
|
133
|
+
typescript: {
|
|
134
|
+
config: withVoidTSConfig(),
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Keep the Kit 2 tsconfig setup:
|
|
140
|
+
|
|
141
|
+
```json
|
|
142
|
+
{
|
|
143
|
+
"extends": "./.svelte-kit/tsconfig.json",
|
|
144
|
+
"compilerOptions": {
|
|
145
|
+
"types": ["void/env"]
|
|
146
|
+
}
|
|
147
|
+
}
|
|
135
148
|
```
|
|
149
|
+
|
|
150
|
+
If your app uses `svelte.config.js` or `svelte.config.ts`, keep its configuration and add `typescript.config: withVoidTSConfig()` under `kit`. Kit 2's `platform.env` remains available in hooks and load functions.
|
|
@@ -89,12 +89,17 @@ These Void features work identically across all targets:
|
|
|
89
89
|
- [Typed fetch client](../guide/typed-fetch.md) (`void/client`)
|
|
90
90
|
- [Custom headers](../guide/edge/headers.md) (`routing.headers`)
|
|
91
91
|
- [Redirects](../guide/edge/redirects.md) (`routing.redirects`)
|
|
92
|
-
- [Environment variables](../guide/env-vars.md) (`.env` files)
|
|
93
92
|
- [Static site generation](../guide/ssg.md)
|
|
94
93
|
- [Vite preview](https://vite.dev/guide/cli#vite-preview) for testing production builds locally
|
|
95
94
|
|
|
96
95
|
## What's Different
|
|
97
96
|
|
|
97
|
+
### Environment variables
|
|
98
|
+
|
|
99
|
+
Supply server values through your host's environment and read them with `process.env` in Node.js or Bun, or `Deno.env.get()` in Deno. The `void/env` schema and secret workflow requires Cloudflare.
|
|
100
|
+
|
|
101
|
+
For browser code, use Vite's `import.meta.env.VITE_*` values. These are embedded at build time and must not contain secrets.
|
|
102
|
+
|
|
98
103
|
### No Cloudflare bindings
|
|
99
104
|
|
|
100
105
|
The following imports are **not available** with a non-CF target and produce a compile-time error:
|
|
@@ -106,7 +111,7 @@ The following imports are **not available** with a non-CF target and produce a c
|
|
|
106
111
|
| `void/storage` | R2 (blob storage) |
|
|
107
112
|
| `void/auth` | Void-managed Better Auth |
|
|
108
113
|
| `void/ai` | Workers AI |
|
|
109
|
-
| `void/env` |
|
|
114
|
+
| `void/env` | Typed environment schema |
|
|
110
115
|
|
|
111
116
|
If you need a database or storage, use an external provider and connect via standard Node.js libraries.
|
|
112
117
|
|
|
@@ -51,25 +51,49 @@ Typed AI client for Cloudflare AI models and provider-native AI Gateway requests
|
|
|
51
51
|
```ts
|
|
52
52
|
import { ai } from 'void/ai';
|
|
53
53
|
|
|
54
|
-
const result = await ai
|
|
55
|
-
|
|
54
|
+
const result = await ai.run('@cf/meta/llama-3.3-70b-instruct-fp8-fast', {
|
|
55
|
+
messages: [{ role: 'user', content: 'Summarize this release note.' }],
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const response = await ai.provider('openai').fetch('/chat/completions', {
|
|
59
|
+
body: {
|
|
60
|
+
model: 'gpt-4o',
|
|
56
61
|
messages: [{ role: 'user', content: 'Summarize this release note.' }],
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const response = await ai
|
|
61
|
-
.provider('openai')
|
|
62
|
-
.fetch('/chat/completions', {
|
|
63
|
-
body: {
|
|
64
|
-
model: 'gpt-4o',
|
|
65
|
-
messages: [{ role: 'user', content: 'Summarize this release note.' }],
|
|
66
|
-
},
|
|
67
|
-
})
|
|
68
|
-
.match({ ok: (result) => result, limited: (limit) => limit.response() });
|
|
62
|
+
},
|
|
63
|
+
});
|
|
69
64
|
```
|
|
70
65
|
|
|
71
66
|
**Key exports:** `ai`, `VoidAi`, provider request types. See [AI](../../guide/ai.md) for provider setup and streaming examples.
|
|
72
67
|
|
|
68
|
+
AI methods return promises and reject usage limits with `UsageLimit` from `void/limits`. Void routes and Pages actions return a structured HTTP 429 for uncaught limits. See [usage limits](../../guide/ai.md#usage-limits) for optional `instanceof UsageLimit` handling.
|
|
69
|
+
|
|
70
|
+
### Provider keys
|
|
71
|
+
|
|
72
|
+
Default secret names for `ai.provider()`. Use `apiKeyEnv` to choose another name.
|
|
73
|
+
|
|
74
|
+
| Provider prefix | Env var |
|
|
75
|
+
| ------------------ | --------------------- |
|
|
76
|
+
| `openai` | `OPENAI_API_KEY` |
|
|
77
|
+
| `anthropic` | `ANTHROPIC_API_KEY` |
|
|
78
|
+
| `google-ai-studio` | `GOOGLE_API_KEY` |
|
|
79
|
+
| `deepseek` | `DEEPSEEK_API_KEY` |
|
|
80
|
+
| `groq` | `GROQ_API_KEY` |
|
|
81
|
+
| `mistral` | `MISTRAL_API_KEY` |
|
|
82
|
+
| `grok` | `GROK_API_KEY` |
|
|
83
|
+
| `openrouter` | `OPENROUTER_API_KEY` |
|
|
84
|
+
| `perplexity` | `PERPLEXITY_API_KEY` |
|
|
85
|
+
| `cohere` | `COHERE_API_KEY` |
|
|
86
|
+
| `cerebras` | `CEREBRAS_API_KEY` |
|
|
87
|
+
| `huggingface` | `HUGGINGFACE_API_KEY` |
|
|
88
|
+
| `replicate` | `REPLICATE_API_KEY` |
|
|
89
|
+
| `baseten` | `BASETEN_API_KEY` |
|
|
90
|
+
| `cartesia` | `CARTESIA_API_KEY` |
|
|
91
|
+
| `deepgram` | `DEEPGRAM_API_KEY` |
|
|
92
|
+
| `elevenlabs` | `ELEVENLABS_API_KEY` |
|
|
93
|
+
| `fal` | `FAL_API_KEY` |
|
|
94
|
+
| `ideogram` | `IDEOGRAM_API_KEY` |
|
|
95
|
+
| `parallel` | `PARALLEL_API_KEY` |
|
|
96
|
+
|
|
73
97
|
## ISR {#isr}
|
|
74
98
|
|
|
75
99
|
Imported from `"void/isr"`.
|
|
@@ -33,37 +33,38 @@ Use this reference to find public imports, signatures, and return types. For set
|
|
|
33
33
|
|
|
34
34
|
Import Void's app-facing APIs from these paths:
|
|
35
35
|
|
|
36
|
-
| Import path | Contents
|
|
37
|
-
| ------------------------- |
|
|
38
|
-
| `void` | `voidPlugin`, handler/type re-exports, `defer`, `Deferred`, `DeferredState`, `InferProps`, `HeadDescriptor`
|
|
39
|
-
| `void/handler` | `defineHandler`, `defineMiddleware`, `basicAuth`, `defineScheduled`, `defineQueue`, `defineRender`, `defineHead`, types
|
|
40
|
-
| `void/auth` | `defineAuth`, `getUser`, `getSession`, `requireAuth`, `AuthUser`, `AuthSession`, `AuthState`
|
|
41
|
-
| `void/client` | `fetch`, `fetchStream`, `FetchError`, `auth`, `createAuthClient`, `AuthUser`, `AuthSession`, `AuthState`
|
|
42
|
-
| `void/client/{framework}` | Same as `void/client`, with framework-specific Better Auth clients for `react`, `vue`, `svelte`, and `solid`
|
|
43
|
-
| `void/ws` | `defineRoom`, `defineWebSocket`, `connect`, WebSocket context and connection types
|
|
44
|
-
| `void/durable` | `defineDurableState`, typed state/RPC/context/migration types
|
|
45
|
-
| `void/sse` | `eventStream`, `formatSse`, `formatSseText`, `getLastEventId`, `SseStreamClosedError`, SSE message and stream types
|
|
46
|
-
| `void/sse/client` | `connectEventStream`, browser `EventSource` wrapper types
|
|
47
|
-
| `void/live` | `defineLiveStream`, SSE topic fanout runtime types. Server-only.
|
|
48
|
-
| `void/live/client` | `connectLiveStream`, browser helper for one SSE connection plus POST subscribe/unsubscribe control.
|
|
49
|
-
| `void/response` | `convertReturnValue`
|
|
50
|
-
| `void/validator` | `runValidation`, `ValidatorSlots`, `HandlerInput`
|
|
51
|
-
| `void/drizzle-zod` | Re-exports [`drizzle-zod`](https://orm.drizzle.team/docs/zod) for schema-derived Zod validators for Drizzle tables
|
|
52
|
-
| `void/drizzle-valibot` | Re-exports [`drizzle-valibot`](https://orm.drizzle.team/docs/
|
|
53
|
-
| `void/drizzle-arktype` | Re-exports [`drizzle-arktype`](https://orm.drizzle.team/docs/arktype) for schema-derived ArkType validators for Drizzle tables
|
|
54
|
-
| `void/schema-d1` | Re-exports [`drizzle-orm/sqlite-core`](https://orm.drizzle.team/docs/column-types/sqlite) for D1 table and column builders
|
|
55
|
-
| `void/schema-pg` | Re-exports [`drizzle-orm/pg-core`](https://orm.drizzle.team/docs/column-types/pg) for PostgreSQL table and column builders
|
|
56
|
-
| `void/schema-mysql` | Re-exports `drizzle-orm/mysql-core` for MySQL table and column builders
|
|
57
|
-
| `void/database-provider` | `defineDatabaseProvider` and adapter types for `void db connect --provider`
|
|
58
|
-
| `void/db` | `db` (Drizzle D1, PostgreSQL, or MySQL instance for the active dialect), `createDb`, query operators (`eq`, `and`, `or`, `desc`, `like`, `inArray`, etc.)
|
|
59
|
-
| `void/seed` | `defineSeed`, `SeedContext`, `SeedFn` for programmatic `void db seed` modules
|
|
60
|
-
| `void/kv` | `kv`, `createKV`, typed KV client/map types
|
|
61
|
-
| `void/storage` | `storage`, `createStorage` for the inferred R2 binding or a specific `R2Bucket`
|
|
62
|
-
| `void/ai` | `ai`, `VoidAi`, model input and response types
|
|
63
|
-
| `void/
|
|
64
|
-
| `void/
|
|
65
|
-
| `void/
|
|
66
|
-
| `void/
|
|
67
|
-
| `void/
|
|
68
|
-
| `void/
|
|
69
|
-
| `void/
|
|
36
|
+
| Import path | Contents |
|
|
37
|
+
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
38
|
+
| `void` | `voidPlugin`, handler/type re-exports, `defer`, `Deferred`, `DeferredState`, `InferProps`, `HeadDescriptor` |
|
|
39
|
+
| `void/handler` | `defineHandler`, `defineMiddleware`, `basicAuth`, `defineScheduled`, `defineQueue`, `defineRender`, `defineHead`, types |
|
|
40
|
+
| `void/auth` | `defineAuth`, `getUser`, `getSession`, `requireAuth`, `AuthUser`, `AuthSession`, `AuthState` |
|
|
41
|
+
| `void/client` | `fetch`, `fetchStream`, `FetchError`, `auth`, `createAuthClient`, `AuthUser`, `AuthSession`, `AuthState` |
|
|
42
|
+
| `void/client/{framework}` | Same as `void/client`, with framework-specific Better Auth clients for `react`, `vue`, `svelte`, and `solid` |
|
|
43
|
+
| `void/ws` | `defineRoom`, `defineWebSocket`, `connect`, WebSocket context and connection types |
|
|
44
|
+
| `void/durable` | `defineDurableState`, typed state/RPC/context/migration types |
|
|
45
|
+
| `void/sse` | `eventStream`, `formatSse`, `formatSseText`, `getLastEventId`, `SseStreamClosedError`, SSE message and stream types |
|
|
46
|
+
| `void/sse/client` | `connectEventStream`, browser `EventSource` wrapper types |
|
|
47
|
+
| `void/live` | `defineLiveStream`, SSE topic fanout runtime types. Server-only. |
|
|
48
|
+
| `void/live/client` | `connectLiveStream`, browser helper for one SSE connection plus POST subscribe/unsubscribe control. |
|
|
49
|
+
| `void/response` | `convertReturnValue` |
|
|
50
|
+
| `void/validator` | `runValidation`, `ValidatorSlots`, `HandlerInput` |
|
|
51
|
+
| `void/drizzle-zod` | Re-exports [`drizzle-zod`](https://orm.drizzle.team/docs/zod) for schema-derived Zod validators for Drizzle tables |
|
|
52
|
+
| `void/drizzle-valibot` | Re-exports [`drizzle-valibot`](https://orm.drizzle.team/docs/valibot) for schema-derived Valibot validators for Drizzle tables |
|
|
53
|
+
| `void/drizzle-arktype` | Re-exports [`drizzle-arktype`](https://orm.drizzle.team/docs/arktype) for schema-derived ArkType validators for Drizzle tables |
|
|
54
|
+
| `void/schema-d1` | Re-exports [`drizzle-orm/sqlite-core`](https://orm.drizzle.team/docs/column-types/sqlite) for D1 table and column builders |
|
|
55
|
+
| `void/schema-pg` | Re-exports [`drizzle-orm/pg-core`](https://orm.drizzle.team/docs/column-types/pg) for PostgreSQL table and column builders |
|
|
56
|
+
| `void/schema-mysql` | Re-exports `drizzle-orm/mysql-core` for MySQL table and column builders |
|
|
57
|
+
| `void/database-provider` | `defineDatabaseProvider` and adapter types for `void db connect --provider` |
|
|
58
|
+
| `void/db` | `db` (Drizzle D1, PostgreSQL, or MySQL instance for the active dialect), `createDb`, query operators (`eq`, `and`, `or`, `desc`, `like`, `inArray`, etc.) |
|
|
59
|
+
| `void/seed` | `defineSeed`, `SeedContext`, `SeedFn` for programmatic `void db seed` modules |
|
|
60
|
+
| `void/kv` | `kv`, `createKV`, typed KV client/map types |
|
|
61
|
+
| `void/storage` | `storage`, `createStorage` for the inferred R2 binding or a specific `R2Bucket` |
|
|
62
|
+
| `void/ai` | `ai`, `VoidAi`, model input and response types |
|
|
63
|
+
| `void/limits` | `UsageLimit`, `UsageLimitData`, and `readUsageLimit`. AI and Sandbox limits reject with `UsageLimit`; uncaught limits in Void routes and Pages actions return structured HTTP 429 responses. |
|
|
64
|
+
| `void/isr` | `revalidate(options)` for on-demand ISR cache invalidation |
|
|
65
|
+
| `void/log` | `logger` structured logging helper |
|
|
66
|
+
| `void/routes` | `RouteMap` and `WebSocketRouteMap` stubs (types only) |
|
|
67
|
+
| `void/queues` | `queues` proxy for sending messages to typed queues |
|
|
68
|
+
| `void/sandbox` | `getSandbox`, `sandbox`, `SandboxLimitError`, `SandboxUnavailableError`, and the SDK 1.0 file, backup, and mount helpers. `getSandbox(id)` resolves a client. Commands, files, port requests, and process completion return promises; limits reject with `SandboxLimitError`, which extends `UsageLimit`. Container state lasts until inactivity (default ten minutes), a crash, or a restart. See [Sandboxes](../guide/sandboxes.md) for the API and deployment requirements. |
|
|
69
|
+
| `void/env` | `defineEnv`, `env`, schema helpers (`string`, `number`, `boolean`, `url`, `email`, `oneOf`, `json`), and global Cloudflare env types |
|
|
70
|
+
| `void/sveltekit` | SvelteKit integration helpers: `withVoidTSConfig()` and `mergeVoidSvelteKitTsconfig()` |
|
|
@@ -6,13 +6,15 @@ outline: deep
|
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
8
|
void connect
|
|
9
|
-
void connect
|
|
9
|
+
void connect platform.example.com
|
|
10
10
|
void connect --platform cloudflare
|
|
11
11
|
void connect --platform void
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
Connect a project to its deployment destination. With no arguments, choose Cloudflare or a Void platform interactively. A URL selects a Void platform directly. `--platform void` offers saved platforms and an option to enter another URL.
|
|
15
15
|
|
|
16
|
+
You can omit `https://` from a platform URL: `void connect platform.example.com` connects to `https://platform.example.com`. This also works in the interactive prompt. For a local HTTP platform, include the scheme, such as `http://localhost:8787`.
|
|
17
|
+
|
|
16
18
|
For Cloudflare, Void signs in through the browser when needed, selects an accessible account, and saves `cloudflare.account_id` in `void.config.ts` or resolved state in `void.lock.json`. It shares this setup with `void init`. An existing account selection is preserved; conflicting or inaccessible account settings must be resolved before continuing.
|
|
17
19
|
|
|
18
20
|
For a Void platform, Void checks the connection and signs you in through your browser when needed. It saves credentials in your system keychain separately for each platform.
|
|
@@ -18,7 +18,7 @@ Deploying to a Void platform requires an explicit connection with `void connect
|
|
|
18
18
|
A saved project URL or `VOID_API_URL` alone does not establish a connection.
|
|
19
19
|
In fresh CI environments, run `void connect "$VOID_API_URL" --no-login` first.
|
|
20
20
|
|
|
21
|
-
On
|
|
21
|
+
On a Void platform, an accepted deployment continues if the CLI disconnects. The CLI automatically reconnects to its progress. Pressing Ctrl+C stops observation; use `void project cancel` to request cancellation and `void project status` to inspect the result. If interrupted execution requires recovery, wait for its result before deploying again.
|
|
22
22
|
|
|
23
23
|
The CLI reports stalled progress and automatic recovery, and waits up to 30 minutes after acceptance. If it times out, the deployment can continue; check `void project status` before trying another deployment.
|
|
24
24
|
|