void 0.24.0 → 0.25.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-DcR1ywt8.mjs} +5 -5
- package/dist/{auth-CQkSDS50.mjs → auth-7wuZ5ob8.mjs} +3 -3
- package/dist/{auth-DX3JURcX.mjs → auth-CdgZ9uag.mjs} +1 -1
- package/dist/{auth-link-D75t9wO2.mjs → auth-link-Z6E5DYvM.mjs} +5 -6
- package/dist/{auth-router-ClfhL1J7.mjs → auth-router-BdM4avI8.mjs} +7 -7
- package/dist/{build-cmd-zMi1iFnS.mjs → build-cmd-CEE7D-hM.mjs} +6 -7
- package/dist/{cache-ZtQmyxVV.mjs → cache-TcZnBLtH.mjs} +6 -7
- package/dist/{cancel-deploy-Box0kkEV.mjs → cancel-deploy-CYoZmcmR.mjs} +4 -6
- package/dist/{cf-access-BGe5sWXF.mjs → cf-access-AHKBzmuu.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 +2 -2
- package/dist/cli/env-schema-probe.mjs +2 -2
- package/dist/client-B4Me-9HE.mjs +2 -0
- package/dist/{client-DKAsFA4X.mjs → client-RsPo8wsP.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-BCdXSsmo.mjs → cloudflare-operations-BhbK6yTq.mjs} +1 -1
- package/dist/{cloudflare-operations-DzH-A966.mjs → cloudflare-operations-CjaV4lZi.mjs} +2 -2
- package/dist/{connect-B-usTnlF.mjs → connect-DCvUmPXY.mjs} +12 -9
- package/dist/{create-project-FWbf5Olo.mjs → create-project-C734I-Mu.mjs} +1 -1
- package/dist/{create-project-CYOOAYcn.mjs → create-project-eAPgYq35.mjs} +6 -6
- package/dist/{db-Ck2eZ2iB.mjs → db-C07GEdKF.mjs} +25 -28
- package/dist/{delete-sK56qtzZ.mjs → delete-pKMVsrpJ.mjs} +5 -6
- package/dist/deploy-BDu1vhSH.mjs +2 -0
- package/dist/{deploy-gCVaiJbS.mjs → deploy-DfsAe-T0.mjs} +9212 -8902
- package/dist/{dev-inbox-P0u4tM8Y.mjs → dev-inbox-D64ZKUod.mjs} +5 -6
- package/dist/{domain-DFfQE8jg.mjs → domain-D3uA9ize.mjs} +8 -8
- package/dist/{email-CdnhUHvJ.mjs → email-z3o2cwjH.mjs} +7 -7
- package/dist/{env-DmGdHi5i.mjs → env-3Q8-_2IH.mjs} +6 -8
- package/dist/{env-validation-zZOCcQVZ.mjs → env-validation-cZBvGWaP.mjs} +1 -1
- package/dist/gen-ById9r2j.mjs +2 -0
- package/dist/{gen-CshAkukR.mjs → gen-NjwoG9FK.mjs} +2 -4
- package/dist/{github-cmd-DftuEvIt.mjs → github-cmd-DquUq-b1.mjs} +7 -16
- package/dist/help-DPGBwomV.mjs +2 -0
- package/dist/{help-Dotbf6iz.mjs → help-DRZXC4fj.mjs} +3 -3
- package/dist/index.d.mts +18 -14
- package/dist/index.mjs +2166 -2096
- package/dist/{info-B97bTX9N.mjs → info-BmA3_IFZ.mjs} +1 -3
- package/dist/{init-BTQEZZGJ.mjs → init-DT7yuuyl.mjs} +16 -18
- package/dist/{link-B46sYH0K.mjs → link-CXOlqh2F.mjs} +6 -7
- package/dist/{list-BnPrIsU_.mjs → list-eEWVJEPn.mjs} +8 -9
- package/dist/{local-d1-2CMnpuW_.mjs → local-d1-Df4XpwhW.mjs} +1 -1
- package/dist/login-C98-sw79.mjs +2 -0
- package/dist/{login-BuiMyUrx.mjs → login-pWQHYVu2.mjs} +9 -7
- package/dist/{logs-CZG9d-ic.mjs → logs-DnxVX7TR.mjs} +7 -8
- package/dist/migrate-CEu2X5DB.mjs +2 -0
- package/dist/{migrate-q4_njtaW.mjs → migrate-CV1on-yJ.mjs} +2 -4
- package/dist/{operator-args-B3BTmSoi.mjs → operator-args-CAVcmwUt.mjs} +1 -1
- package/dist/{operator-auth-7erYc6Lt.mjs → operator-auth-CkmTE3rt.mjs} +2 -2
- package/dist/{operator-client-CpHjTd0t.mjs → operator-client-LmwjxT6q.mjs} +2 -2
- package/dist/{operator-cmd-DGqPJUD3.mjs → operator-cmd-d-IEKgNk.mjs} +6 -6
- package/dist/{output-CbM85T4k.mjs → output-BBsUwdyT.mjs} +5 -5
- package/dist/pages/client.d.mts +3 -0
- package/dist/pages/client.mjs +120 -29
- package/dist/{platform-args-3k8X9-H_.mjs → platform-args-Bzf8JPc2.mjs} +1 -1
- package/dist/platform-args-Cq6EjQro.mjs +2 -0
- package/dist/{platform-auth-config-DDrxUy4m.mjs → platform-auth-config-0V0lA3pF.mjs} +7 -7
- package/dist/{platform-auth-protection-BLadnnct.mjs → platform-auth-protection-DFeJ-JkK.mjs} +8 -8
- package/dist/{platform-auth-recovery-CmCzX2Fl.mjs → platform-auth-recovery-ICy4muq6.mjs} +7 -7
- package/dist/{platform-cmd-pMTRhvYs.mjs → platform-cmd-BPySFOew.mjs} +1 -1
- package/dist/{platform-cmd-DMDEc9uS.mjs → platform-cmd-D7vSWMvV.mjs} +37 -27
- package/dist/platform-discovery-DDDUvnqp.mjs +27 -0
- package/dist/{platform-domain-Di6EYrQl.mjs → platform-domain-CUdY064e.mjs} +4 -4
- package/dist/{platform-lifecycle-BFdSi9Qt.mjs → platform-lifecycle-BaUdTRPU.mjs} +1 -1
- package/dist/{platform-lifecycle-BBoNzojY.mjs → platform-lifecycle-Dm09JNkn.mjs} +3901 -3651
- package/dist/{platform-management-CWOQOWXm.mjs → platform-management-BSEc_ZeG.mjs} +47 -10
- package/dist/platform-management-Bp6aoH2C.mjs +2 -0
- package/dist/{platform-plans-config-Vl9BP3H4.mjs → platform-plans-config-B0pOVQyW.mjs} +3 -3
- package/dist/{platform-recovery-BJnQJEtQ.mjs → platform-recovery-WOZ95Uze.mjs} +3 -3
- package/dist/{prepare-CBLT3CHH.mjs → prepare-39EvOhI6.mjs} +1 -3
- package/dist/{project-DKG5Ra8p.mjs → project-BkbfDs0V.mjs} +1 -1
- package/dist/{project-DsblYifa.mjs → project-IOjBU8R6.mjs} +1 -1
- package/dist/{project-cmd-DxnXstAq.mjs → project-cmd-Bs5A392E.mjs} +21 -22
- package/dist/{project-team-BmHcaALJ.mjs → project-team-ohAWWaew.mjs} +8 -9
- package/dist/{project-token-GionZlBI.mjs → project-token-CP01Jna6.mjs} +6 -9
- package/dist/{project-zero-trust-JLCjVQA7.mjs → project-zero-trust-BzkVgx35.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/{provision-CVku1JFU.mjs → provision-BEv0k-qz.mjs} +1 -1
- package/dist/{provision-CaoxO_U7.mjs → provision-Btj1jppf.mjs} +5 -7
- package/dist/{requests-BOjIVAeF.mjs → requests-B3PBuGlX.mjs} +5 -6
- package/dist/{rollback-CwR3pLj3.mjs → rollback-DDub9GsO.mjs} +9 -10
- package/dist/runtime/email/testing.mjs +1 -1
- package/dist/runtime/email.mjs +35 -17
- package/dist/runtime/routing.mjs +1 -1
- package/dist/{secret-ByWJWBUG.mjs → secret-3c72lY1U.mjs} +15 -16
- package/dist/{skills-C1PlclPt.mjs → skills-BPQUGClu.mjs} +1 -1
- package/dist/{subcommand-prompt-klFCfcor.mjs → subcommand-prompt-Dhom39bd.mjs} +2 -2
- package/dist/sveltekit.d.mts +1 -1
- package/dist/sveltekit.mjs +4 -9
- package/dist/{wrangler-7K-bW_DL.mjs → wrangler-DhUerFkW.mjs} +10 -15
- package/package.json +21 -21
- package/sandbox.Dockerfile +1 -1
- package/skills/void/docs/guide/ai.md +24 -86
- package/skills/void/docs/guide/auth.md +0 -2
- package/skills/void/docs/guide/database/d1.md +7 -7
- 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/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/maintenance.md +30 -10
- package/skills/void/docs/guide/platform/installation/prerequisites.md +79 -7
- package/skills/void/docs/guide/quickstart.md +37 -80
- package/skills/void/docs/guide/sandboxes.md +36 -46
- 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 +27 -0
- package/skills/void/docs/reference/api.md +1 -1
- package/skills/void/docs/reference/cli/deploy.md +1 -1
- package/skills/void/docs/reference/cli/platform-operations.md +4 -8
- package/skills/void/docs/reference/cli/platform.md +5 -0
- package/skills/void/docs/reference/resource-inference.md +11 -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/platform-args-DdnM6WIf.mjs +0 -2
- package/dist/platform-management-DG47jys8.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
- package/dist/{platform-registry-DkPPXfp_.mjs → platform-registry-KfNEF84O.mjs} +1 -1
|
@@ -6,6 +6,12 @@ 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';
|
|
@@ -23,46 +29,7 @@ export const POST = defineHandler(async (c) => {
|
|
|
23
29
|
});
|
|
24
30
|
```
|
|
25
31
|
|
|
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).
|
|
32
|
+
Importing from `void/sandbox` enables the required resources. Local development, direct Cloudflare deployments, and team platforms share the same runtime API.
|
|
66
33
|
|
|
67
34
|
## Runtime API
|
|
68
35
|
|
|
@@ -109,14 +76,37 @@ The `limited` handler receives `resource: 'sandbox'`, a `reason` of `concurrency
|
|
|
109
76
|
|
|
110
77
|
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
78
|
|
|
112
|
-
##
|
|
79
|
+
## Configuration
|
|
113
80
|
|
|
114
|
-
|
|
81
|
+
The default environment provides Node.js 24 on Debian Trixie. Managed platform deploys use Cloudflare's managed Node.js image.
|
|
115
82
|
|
|
116
|
-
`void
|
|
83
|
+
Use `void.config.ts` when you need a custom image or container size:
|
|
117
84
|
|
|
118
|
-
|
|
85
|
+
```ts
|
|
86
|
+
import { defineConfig } from 'void/config';
|
|
119
87
|
|
|
120
|
-
|
|
88
|
+
export default defineConfig({
|
|
89
|
+
sandbox: {
|
|
90
|
+
image: './Dockerfile.sandbox',
|
|
91
|
+
platformImage: 'registry.cloudflare.com/<account-id>/sandbox@sha256:<digest>',
|
|
92
|
+
instanceType: 'standard-1',
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
See the [configuration reference](../reference/config.md#sandbox) for binding names, image settings, and container sizes.
|
|
98
|
+
|
|
99
|
+
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:
|
|
100
|
+
|
|
101
|
+
```dockerfile
|
|
102
|
+
FROM node:24.21.0-trixie-slim
|
|
103
|
+
COPY --from=docker.io/cloudflare/sandbox:1.0.0 /usr/local/bin/sandbox-shim /usr/local/bin/sandbox-shim
|
|
104
|
+
WORKDIR /workspace
|
|
105
|
+
CMD ["sleep", "infinity"]
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
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).
|
|
109
|
+
|
|
110
|
+
## Deployment
|
|
121
111
|
|
|
122
|
-
|
|
112
|
+
`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
|
|
|
@@ -70,6 +70,33 @@ const response = await ai
|
|
|
70
70
|
|
|
71
71
|
**Key exports:** `ai`, `VoidAi`, provider request types. See [AI](../../guide/ai.md) for provider setup and streaming examples.
|
|
72
72
|
|
|
73
|
+
### Provider keys
|
|
74
|
+
|
|
75
|
+
Default secret names for `ai.provider()`. Use `apiKeyEnv` to choose another name.
|
|
76
|
+
|
|
77
|
+
| Provider prefix | Env var |
|
|
78
|
+
| ------------------ | --------------------- |
|
|
79
|
+
| `openai` | `OPENAI_API_KEY` |
|
|
80
|
+
| `anthropic` | `ANTHROPIC_API_KEY` |
|
|
81
|
+
| `google-ai-studio` | `GOOGLE_API_KEY` |
|
|
82
|
+
| `deepseek` | `DEEPSEEK_API_KEY` |
|
|
83
|
+
| `groq` | `GROQ_API_KEY` |
|
|
84
|
+
| `mistral` | `MISTRAL_API_KEY` |
|
|
85
|
+
| `grok` | `GROK_API_KEY` |
|
|
86
|
+
| `openrouter` | `OPENROUTER_API_KEY` |
|
|
87
|
+
| `perplexity` | `PERPLEXITY_API_KEY` |
|
|
88
|
+
| `cohere` | `COHERE_API_KEY` |
|
|
89
|
+
| `cerebras` | `CEREBRAS_API_KEY` |
|
|
90
|
+
| `huggingface` | `HUGGINGFACE_API_KEY` |
|
|
91
|
+
| `replicate` | `REPLICATE_API_KEY` |
|
|
92
|
+
| `baseten` | `BASETEN_API_KEY` |
|
|
93
|
+
| `cartesia` | `CARTESIA_API_KEY` |
|
|
94
|
+
| `deepgram` | `DEEPGRAM_API_KEY` |
|
|
95
|
+
| `elevenlabs` | `ELEVENLABS_API_KEY` |
|
|
96
|
+
| `fal` | `FAL_API_KEY` |
|
|
97
|
+
| `ideogram` | `IDEOGRAM_API_KEY` |
|
|
98
|
+
| `parallel` | `PARALLEL_API_KEY` |
|
|
99
|
+
|
|
73
100
|
## ISR {#isr}
|
|
74
101
|
|
|
75
102
|
Imported from `"void/isr"`.
|
|
@@ -49,7 +49,7 @@ Import Void's app-facing APIs from these paths:
|
|
|
49
49
|
| `void/response` | `convertReturnValue` |
|
|
50
50
|
| `void/validator` | `runValidation`, `ValidatorSlots`, `HandlerInput` |
|
|
51
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/
|
|
52
|
+
| `void/drizzle-valibot` | Re-exports [`drizzle-valibot`](https://orm.drizzle.team/docs/valibot) for schema-derived Valibot validators for Drizzle tables |
|
|
53
53
|
| `void/drizzle-arktype` | Re-exports [`drizzle-arktype`](https://orm.drizzle.team/docs/arktype) for schema-derived ArkType validators for Drizzle tables |
|
|
54
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
55
|
| `void/schema-pg` | Re-exports [`drizzle-orm/pg-core`](https://orm.drizzle.team/docs/column-types/pg) for PostgreSQL table and column builders |
|
|
@@ -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
|
|
|
@@ -17,11 +17,7 @@ void platform deployment migrate-assets <id> [--cursor <cursor>] [--plan|--yes]
|
|
|
17
17
|
|
|
18
18
|
Cancellation applies while a deployment is pending, uploading, migrating, or prerendering, and can be requested again while it is canceling. A deployment that has begun switching traffic, is compensating for a failure, or has finished cannot be canceled through this command.
|
|
19
19
|
|
|
20
|
-
`migrate-assets` copies legacy assets to scoped R2 storage
|
|
21
|
-
|
|
22
|
-
Use `--plan` to preview the first batch. Applying authorizes all remaining batches for that deployment; the CLI previews each batch and prints its result, including `nextCursor`. With `--json`, results are JSON Lines. If a later batch fails or the command is interrupted, resume with the cursor from the last successful result. An ambiguous request is never retried automatically; inspect the deployment before resuming. A completed migration reports `complete: true` and `nextCursor: null`.
|
|
23
|
-
|
|
24
|
-
Use [`void platform system asset-migrations`](#operator-system) to find deployments requiring migration. Inspect every inventory page, migrate each deployment with `needsMigration` greater than zero, then inspect every page again. Include retained rollback deployments and stored bundles. Investigate rows marked `invalid` before considering migration complete. Keep the older asset readers until the full inventory is valid and no protected deployment needs migration.
|
|
20
|
+
`migrate-assets` copies a deployment's legacy assets to scoped R2 storage without changing application traffic. Use `--plan` to preview and `--cursor` to resume from a successful batch. Original assets remain in place.
|
|
25
21
|
|
|
26
22
|
Read its runtime logs with:
|
|
27
23
|
|
|
@@ -44,7 +40,7 @@ void platform build logs <id> [--since <sequence>] [--limit <n>] [--follow]
|
|
|
44
40
|
|
|
45
41
|
Build logs start at sequence `0` and return up to 500 lines. Use the returned `lastSeq` as `--since` to continue; `--limit` accepts 1 to 500. Container log retrieval requires managed builds to be enabled. GitHub Actions builds return an external log URL.
|
|
46
42
|
|
|
47
|
-
Following waits for the final logs after the build becomes terminal. If completion cannot be confirmed within two minutes, the command exits with an error.
|
|
43
|
+
Following waits for the final logs after the build becomes terminal. If completion cannot be confirmed within two minutes, the command exits with an error.
|
|
48
44
|
|
|
49
45
|
## System {#operator-system}
|
|
50
46
|
|
|
@@ -62,11 +58,11 @@ void platform system sandbox-drain [--cursor <opaque-cursor>]
|
|
|
62
58
|
|
|
63
59
|
`overview` shows platform totals and recent activity. `health` checks the configured services and database, and exits with a nonzero status if a check fails. `cli-versions` reports the CLI versions used by deployments.
|
|
64
60
|
|
|
65
|
-
`asset-migrations` inventories
|
|
61
|
+
`asset-migrations` inventories stored deployment assets and reports `needsMigration` and `invalid` counts. Use the response's pagination fields to read all entries.
|
|
66
62
|
|
|
67
63
|
`events` shows the administrator, target, and outcome of changes. A pending event means the outcome has not been recorded. Previews and session login/logout do not create these events. `backfill-queue-tokens` repairs older queue entries that are missing authentication tokens and supports `--plan` before applying the repair.
|
|
68
64
|
|
|
69
|
-
|
|
65
|
+
`sandbox-drain` removes legacy tenant-owned Sandbox resources. Use `--plan` to preview and `--yes` to apply, then pass `nextCursor` as `--cursor` to continue. Application traffic stays paused during cleanup.
|
|
70
66
|
|
|
71
67
|
Use the [platform lifecycle commands](./platform-installation.md#lifecycle-commands) to maintain your installation's Workers.
|
|
72
68
|
|
|
@@ -16,6 +16,11 @@ void platform status [id]
|
|
|
16
16
|
|
|
17
17
|
`use` and `status` auto-select the only configured platform; with multiple platforms they show a picker interactively and require an id or URL in non-interactive use. A project with a recorded platform URL keeps using that platform when the global default changes.
|
|
18
18
|
|
|
19
|
+
For a self-hosted installation, `status <installation-id>` prints locally saved
|
|
20
|
+
lifecycle progress before checking the live API. The saved checkpoint may be out
|
|
21
|
+
of date. If live discovery fails during maintenance, the command still shows that
|
|
22
|
+
checkpoint and exits with an error; it does not confirm current availability.
|
|
23
|
+
|
|
19
24
|
## Operator commands {#operator-commands}
|
|
20
25
|
|
|
21
26
|
Use `void platform` to administer the users and apps on your selected platform. Start with the [Platform Administration guide](../../guide/platform-administration.md) for signing in, giving people access, and investigating deployments.
|
|
@@ -27,7 +27,7 @@ Durable state is inferred from files in `durable-objects/`. For example, `durabl
|
|
|
27
27
|
|
|
28
28
|
### Standard mode
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Native Void apps scan these directories by default. With [`sourceDir`](./config.md#sourcedir) configured, Void scans that source tree instead:
|
|
31
31
|
|
|
32
32
|
| Directory | Contains |
|
|
33
33
|
| ------------- | ------------------------------------------- |
|
|
@@ -36,10 +36,12 @@ When using Void's built-in routing (no meta-framework), these directories are sc
|
|
|
36
36
|
| `queues/` | Queue consumers |
|
|
37
37
|
| `pages/` | Page components and `.server.ts` companions |
|
|
38
38
|
| `crons/` | Scheduled job handlers |
|
|
39
|
+
| `email/` | Inbound email handlers |
|
|
40
|
+
| `src/` | Application source |
|
|
39
41
|
|
|
40
42
|
### Framework mode
|
|
41
43
|
|
|
42
|
-
|
|
44
|
+
For [supported meta frameworks](../integrations/frameworks/overview.md), Void scans these directories:
|
|
43
45
|
|
|
44
46
|
| Directory | Contains |
|
|
45
47
|
| --------- | ----------------------- |
|
|
@@ -47,17 +49,18 @@ When a meta-framework is detected (TanStack Start, React Router, SvelteKit, Nuxt
|
|
|
47
49
|
| `app/` | Framework app directory |
|
|
48
50
|
| `routes/` | Framework routes |
|
|
49
51
|
| `server/` | Server-side code |
|
|
52
|
+
| `pages/` | Framework pages |
|
|
53
|
+
| `crons/` | Scheduled job handlers |
|
|
54
|
+
| `queues/` | Queue consumers |
|
|
50
55
|
|
|
51
|
-
Framework detection
|
|
52
|
-
|
|
53
|
-
For SvelteKit, Nuxt, and Astro, add `voidPlugin()` to the framework's Vite config to enable inference during dev. See [Frameworks Integration](../integrations/frameworks/overview.md) for setup details.
|
|
56
|
+
Framework detection uses `package.json` dependencies and dev dependencies. Add `voidPlugin()` to your framework's Vite config to enable inference during development. The integration guides show the setup for each framework.
|
|
54
57
|
|
|
55
58
|
### Always scanned
|
|
56
59
|
|
|
57
60
|
Regardless of mode, these are always checked:
|
|
58
61
|
|
|
59
62
|
- **SSR entry** such as `src/main.ssr.ts`, for SSR apps that access bindings during rendering
|
|
60
|
-
-
|
|
63
|
+
- **Application source** in `src/` or your configured `sourceDir`, including resource and auth imports
|
|
61
64
|
- **`durable-objects/`**, which is scanned for typed Durable Object state modules in native Void apps
|
|
62
65
|
|
|
63
66
|
## Custom Scan Directories
|
|
@@ -72,7 +75,7 @@ If your project organizes code in non-standard directories, you can override whi
|
|
|
72
75
|
}
|
|
73
76
|
```
|
|
74
77
|
|
|
75
|
-
Paths are relative to the project root. When `inference.scanDirs` is set, it replaces the default directories entirely.
|
|
78
|
+
Paths are relative to the project root. When `inference.scanDirs` is set, it replaces the default directories entirely. The SSR entry and application source scan still apply.
|
|
76
79
|
|
|
77
80
|
## Explicit Binding Overrides
|
|
78
81
|
|
|
@@ -95,4 +98,4 @@ Explicit values override only their named bindings. Omitted bindings continue to
|
|
|
95
98
|
|
|
96
99
|
## File Types
|
|
97
100
|
|
|
98
|
-
Inference scans
|
|
101
|
+
Inference scans `.ts`, `.tsx`, `.mts`, `.js`, `.jsx`, `.mjs`, and Astro frontmatter. Put server resource imports in these files or a page's `.server.ts` companion; Vue and Svelte component files are not scanned directly.
|
package/dist/client-B9UBI03V.mjs
DELETED
package/dist/deploy-irP5q0-x.mjs
DELETED
package/dist/gen-DvQTWzDU.mjs
DELETED
package/dist/help-mabuIV98.mjs
DELETED
package/dist/login-DIy9Sb-U.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { c as selectAuthoritativePlatformManifest, s as runInstalledPlatformCommand, u as verifyPlatformInstallationOwnership } from "./platform-management-CWOQOWXm.mjs";
|
|
2
|
-
export { runInstalledPlatformCommand, selectAuthoritativePlatformManifest, verifyPlatformInstallationOwnership };
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
# Environment migration
|
|
2
|
-
|
|
3
|
-
Use `.env` for local development and remote secrets for server-side production values.
|
|
4
|
-
|
|
5
|
-
## 1. Back up and consolidate values
|
|
6
|
-
|
|
7
|
-
Before changing any dotenv files, securely back up the production values you need to migrate outside the project directory. Keep them out of Git. Do not delete the original files until the upload and verification in step 3 succeed.
|
|
8
|
-
|
|
9
|
-
Merge the values you still need locally into `.env`:
|
|
10
|
-
|
|
11
|
-
```text
|
|
12
|
-
.env.local
|
|
13
|
-
.env.development
|
|
14
|
-
.env.development.local
|
|
15
|
-
→ .env
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Keep the legacy files for now. You will remove them in step 5, after migrating their values.
|
|
19
|
-
|
|
20
|
-
Ensure `.env` is ignored by Git:
|
|
21
|
-
|
|
22
|
-
```text
|
|
23
|
-
.env
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## 2. Update `env.ts`
|
|
27
|
-
|
|
28
|
-
Remove `.secret()` and `.public()` from `env.ts` before running secret commands.
|
|
29
|
-
|
|
30
|
-
Change:
|
|
31
|
-
|
|
32
|
-
```ts
|
|
33
|
-
export default defineEnv({
|
|
34
|
-
STRIPE_KEY: string().secret(),
|
|
35
|
-
VITE_API_ORIGIN: url().public(),
|
|
36
|
-
});
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
to:
|
|
40
|
-
|
|
41
|
-
```ts
|
|
42
|
-
export default defineEnv({
|
|
43
|
-
STRIPE_KEY: string(),
|
|
44
|
-
VITE_API_ORIGIN: url(),
|
|
45
|
-
});
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Server keys have no `VITE_` prefix; client keys do.
|
|
49
|
-
|
|
50
|
-
## 3. Upload server secrets
|
|
51
|
-
|
|
52
|
-
For managed Void projects, upload each non-client schema key:
|
|
53
|
-
|
|
54
|
-
```sh
|
|
55
|
-
void secret put DATABASE_URL
|
|
56
|
-
void secret put STRIPE_KEY
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
To migrate a production file in one pass, prepare a copy outside the project directory containing only server keys declared in `env.ts`, then upload it:
|
|
60
|
-
|
|
61
|
-
```sh
|
|
62
|
-
void secret sync /secure/path/production-secrets.txt
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
The sync command validates every entry against `env.ts`. It rejects undeclared names, invalid values, and client-prefixed names. Keep client-prefixed values for step 4 instead of including them in this file.
|
|
66
|
-
|
|
67
|
-
For direct Cloudflare deployments, select Cloudflare and use the same commands:
|
|
68
|
-
|
|
69
|
-
```sh
|
|
70
|
-
void connect --platform cloudflare
|
|
71
|
-
void secret put DATABASE_URL
|
|
72
|
-
void secret put STRIPE_KEY
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
After the upload succeeds, confirm that all expected server names appear in the remote store:
|
|
76
|
-
|
|
77
|
-
```sh
|
|
78
|
-
void secret list
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
If an upload fails or a name is missing, keep the source values and retry before continuing.
|
|
82
|
-
|
|
83
|
-
For direct Cloudflare deployments, remove the migrated server keys from `cloudflare.vars` in `void.config.ts` after confirming the upload. Void now treats any schema-declared server key in Worker `vars` as an error.
|
|
84
|
-
|
|
85
|
-
## 4. Set client build values
|
|
86
|
-
|
|
87
|
-
Move `VITE_*` production values to CI/build-shell variables, or make the value an explicit schema default:
|
|
88
|
-
|
|
89
|
-
```sh
|
|
90
|
-
export VITE_API_ORIGIN=https://api.example.com
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
Keep these variables set for the remote check and deployment in step 5. Client values are compiled into browser assets and are public.
|
|
94
|
-
|
|
95
|
-
These values are also available during server rendering. Do not upload them as remote secrets.
|
|
96
|
-
|
|
97
|
-
## 5. Remove old files and verify
|
|
98
|
-
|
|
99
|
-
Once the local values are in `.env`, the server values are uploaded and listed remotely, and the client values are available to the build, delete every `.env.*` file, `.env.example`, and `.dev.vars*` file from the project. Keep the secure backup until verification succeeds. Environment checks and deployment reject these old files.
|
|
100
|
-
|
|
101
|
-
Use `env.ts` as the checked-in list of names, types, defaults, and requiredness. `void env example` is no longer supported.
|
|
102
|
-
|
|
103
|
-
Then verify:
|
|
104
|
-
|
|
105
|
-
```sh
|
|
106
|
-
void env check
|
|
107
|
-
void env check --remote
|
|
108
|
-
void deploy
|
|
109
|
-
```
|