void 1.7.0 → 1.9.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.
Files changed (314) hide show
  1. package/dist/{account-cmd-BfkJ_1PC.mjs → account-cmd-BEMOdwtl.mjs} +5 -5
  2. package/dist/{application-analysis-OV0CBJ80.mjs → application-analysis-3VVsflWZ.mjs} +28 -8
  3. package/dist/{application-routing-QpyC5G8z.mjs → application-routing-CJRlXCc2.mjs} +1 -1
  4. package/dist/{auth-CZrthGxs.d.mts → auth-CV9kXHKe.d.mts} +4 -2
  5. package/dist/{auth-DyWp-fSo.mjs → auth-aMuFOZeI.mjs} +8 -2
  6. package/dist/{auth-link-CW1Zh6FM.mjs → auth-link-B1IynRW5.mjs} +5 -5
  7. package/dist/{auth-router-CNBKnEZi.mjs → auth-router-DVaWJdRB.mjs} +3 -3
  8. package/dist/{better-auth-shared-CdVyCUou.mjs → better-auth-shared-C7LHvF4L.mjs} +1 -1
  9. package/dist/{better-auth-shared-C-0uZg8-.d.mts → better-auth-shared-ajs3LNrY.d.mts} +2 -2
  10. package/dist/boundary-plans-CRmWH68v.d.mts +25 -0
  11. package/dist/{build-cmd-C9qOKW9W.mjs → build-cmd-Dq8tdqQG.mjs} +4 -4
  12. package/dist/{cache-DVBBbWQL.mjs → cache-DGMnskX7.mjs} +4 -4
  13. package/dist/{cancel-deploy-COavnjud.mjs → cancel-deploy-96S5hD1E.mjs} +3 -3
  14. package/dist/cli/cli.mjs +1 -1
  15. package/dist/cli/cloudflare-operation-process.mjs +92 -19
  16. package/dist/cli/env-schema-probe.d.mts +1 -1
  17. package/dist/cli/env-schema-probe.mjs +3 -3
  18. package/dist/{cli-main-DFteHrJI.mjs → cli-main-CQRLxZAu.mjs} +32 -32
  19. package/dist/client-66c0RLDM.mjs +1 -0
  20. package/dist/{client-BEZmTP6p.mjs → client-D6w5x7hM.mjs} +7 -7
  21. package/dist/{cloudflare-auth-DGIivpTb.mjs → cloudflare-auth-pNvmT6kL.mjs} +1 -1
  22. package/dist/{cloudflare-cmd-DJaxC-bc.mjs → cloudflare-cmd-BuuHUM4z.mjs} +5 -5
  23. package/dist/{cloudflare-config-DtOGAbeB.mjs → cloudflare-config-PxbinLLE.mjs} +2 -2
  24. package/dist/{cloudflare-connect-BjpWmglw.mjs → cloudflare-connect-D1QOosLd.mjs} +3 -3
  25. package/dist/{cloudflare-operations-k7wYUv56.mjs → cloudflare-operations-G5AObYzF.mjs} +6 -6
  26. package/dist/{cloudflare-operations-CZkjFrzH.mjs → cloudflare-operations-I4t3mt4R.mjs} +1 -1
  27. package/dist/{cloudflare-process-BcPvlMFd.mjs → cloudflare-process-wcnaQ5JG.mjs} +2 -2
  28. package/dist/{config-wo2EaH0X.mjs → config-C1DPf8EK.mjs} +1 -1
  29. package/dist/{config-CTlUaXWZ.d.mts → config-CCWVY7DY.d.mts} +1 -1
  30. package/dist/{config-5oSQhZNj.mjs → config-CzFdJYNA.mjs} +1 -1
  31. package/dist/{config-DcqUBGCb.mjs → config-DlWQ_hIJ.mjs} +3 -3
  32. package/dist/{config-eeDzKBS9.mjs → config-Do7gJI3T.mjs} +2 -2
  33. package/dist/config-entry.d.mts +1 -1
  34. package/dist/{connect-j1F1C_rW.mjs → connect-4uImOwut.mjs} +6 -6
  35. package/dist/{create-project-CE3jOmd5.mjs → create-project-BaUzZnLZ.mjs} +4 -4
  36. package/dist/{create-project-DZH3aYGQ.mjs → create-project-CQMyzTvK.mjs} +1 -1
  37. package/dist/{db-DyLzzxvM.mjs → db-DEpDeDsi.mjs} +22 -22
  38. package/dist/{db-types-DdHHUVPy.mjs → db-types-BpPYAx0B.mjs} +4 -2
  39. package/dist/{delete-Dey6YoMA.mjs → delete-BVD2kI82.mjs} +4 -4
  40. package/dist/deploy-Dr_Qamzw.mjs +2 -0
  41. package/dist/{deploy-Ccw2D2lw.mjs → deploy-Dyeo5soA.mjs} +40 -81
  42. package/dist/{deploy-managed-static-BBVtpuGv.mjs → deploy-managed-static-Kn73R83A.mjs} +22 -22
  43. package/dist/{deploy-transport-Dt0IvSVW.mjs → deploy-transport-BpKBs_KR.mjs} +3 -3
  44. package/dist/deploy.mjs +6 -6
  45. package/dist/discover-Diq0l6TZ.mjs +1 -0
  46. package/dist/{discover-CVFCWU7W.mjs → discover-Vd18lHsj.mjs} +1 -1
  47. package/dist/{dispatch-pYaww76u.mjs → dispatch-BBfb519j.mjs} +8 -8
  48. package/dist/{dist-DeTdhbZc.mjs → dist-Cp4b1_T9.mjs} +1 -1
  49. package/dist/{dist-BQdgCVQF.mjs → dist-STQXl8ck.mjs} +86 -138
  50. package/dist/{domain-Dh3mG8Vs.mjs → domain-BTIdyUVk.mjs} +5 -5
  51. package/dist/{drizzle-C8MPqt5m.mjs → drizzle-D4V_06-B.mjs} +1 -1
  52. package/dist/{drizzle-lFdzSEa9.mjs → drizzle-DBSpPpU1.mjs} +34 -8
  53. package/dist/{email-DKyMjOYM.mjs → email-DvrS-I0U.mjs} +10 -10
  54. package/dist/{email-cloudflare-CTt2n_W2.mjs → email-cloudflare-DAGpgzY1.mjs} +16 -11
  55. package/dist/{entry-Bw-G1VVx.mjs → entry-DMgR7XOf.mjs} +2 -2
  56. package/dist/{env-DkZzh_Dd.mjs → env-D7vORwpn.mjs} +6 -6
  57. package/dist/{env-CuzZZyjB.mjs → env-UqS-21xi.mjs} +8 -1
  58. package/dist/{env-public-CeNeO_AT.d.mts → env-public-DtJL_hZq.d.mts} +8 -7
  59. package/dist/{env-types-Dz9qkiOn.mjs → env-types-WEZw5D-r.mjs} +1 -1
  60. package/dist/{env-validation-C8NL3lEH.mjs → env-validation-DKDcpxbt.mjs} +1 -1
  61. package/dist/{env-validation-1snjKtDX.mjs → env-validation-DeYNRp1d.mjs} +5 -5
  62. package/dist/{gen-BZmFOGDQ.mjs → gen-DimkGNve.mjs} +6 -6
  63. package/dist/gen-DmEeVEs4.mjs +1 -0
  64. package/dist/{github-cmd-7Oky9qgH.mjs → github-cmd-D-zs6VQr.mjs} +4 -4
  65. package/dist/{handler-DjqciiDc.d.mts → handler-6fzr_ikp.d.mts} +5 -4
  66. package/dist/{head-MeF_5M_3.d.mts → head-CVO92KEx.d.mts} +14 -3
  67. package/dist/{head-5XPcnG-j.mjs → head-CWJhfUwV.mjs} +62 -3
  68. package/dist/{headers-CimYIfQI.mjs → headers-Q0kZDpk8.mjs} +11 -2
  69. package/dist/{help-CNuUb47C.mjs → help-Cgdcd-SG.mjs} +6 -6
  70. package/dist/help-Cp3K5m1w.mjs +1 -0
  71. package/dist/index.d.mts +5 -5
  72. package/dist/index.mjs +257 -188
  73. package/dist/{info-DwB8IWIx.mjs → info-BbxQ34kk.mjs} +4 -4
  74. package/dist/{init-CUGSmcED.mjs → init-zyRj3QRw.mjs} +19 -20
  75. package/dist/{link-BlRTGHan.mjs → link-DAFXuIER.mjs} +5 -5
  76. package/dist/{list-iCg7d5Pa.mjs → list-BTIcC3W9.mjs} +5 -5
  77. package/dist/{live-zKGbRT4h.d.mts → live-DBybyDt0.d.mts} +2 -2
  78. package/dist/{live-CYJ4KGoR.mjs → live-Dw7NF1t2.mjs} +1 -1
  79. package/dist/load-user-env-ztmIyiLx.mjs +34 -0
  80. package/dist/{local-d1-CFcH9Bx3.mjs → local-d1-BnVb7Fem.mjs} +1 -1
  81. package/dist/login-DBs8JuSl.mjs +1 -0
  82. package/dist/{login-TA51e5Fw.mjs → login-DOE-MkeK.mjs} +4 -4
  83. package/dist/{logs-BlyAxlvx.mjs → logs-CUsjihc3.mjs} +4 -4
  84. package/dist/migrate-BYhoIK9R.mjs +1 -0
  85. package/dist/{migrate-BH6LCr00.mjs → migrate-DtoKdGas.mjs} +6 -6
  86. package/dist/nitro.mjs +3 -3
  87. package/dist/{node-B0otYjDv.mjs → node-D9dPyUr0.mjs} +4 -4
  88. package/dist/operator-ai-logging-DFTEp81Z.mjs +121 -0
  89. package/dist/{operator-args-DuKAQ3Ks.mjs → operator-args-BCCohcz3.mjs} +10 -1
  90. package/dist/{operator-cmd-CoHlJjcT.mjs → operator-cmd-CQOQrUiO.mjs} +27 -7
  91. package/dist/operator-cmd-xCACDtT1.mjs +1 -0
  92. package/dist/output-BsdnNpxa.mjs +1 -0
  93. package/dist/{output-CXJTIAtF.mjs → output-DNVILSz2.mjs} +1 -1
  94. package/dist/pages/client.d.mts +28 -3
  95. package/dist/pages/client.mjs +146 -27
  96. package/dist/pages/head.d.mts +2 -2
  97. package/dist/pages/head.mjs +1 -1
  98. package/dist/pages/index.d.mts +5 -4
  99. package/dist/pages/index.mjs +5 -5
  100. package/dist/pages/islands-plugin.d.mts +6 -2
  101. package/dist/pages/islands-plugin.mjs +18 -3
  102. package/dist/pages/protocol.d.mts +2 -2
  103. package/dist/pages/protocol.mjs +1 -1
  104. package/dist/platform-args-DSi4_M8n.mjs +1 -0
  105. package/dist/{platform-args-DfT8yQBF.mjs → platform-args-DtpHS_75.mjs} +1 -1
  106. package/dist/{platform-auth-config-MO0VdVs9.mjs → platform-auth-config-fLwIS5VG.mjs} +6 -6
  107. package/dist/{platform-auth-protection-Dv208eyL.mjs → platform-auth-protection-BTRI_YwD.mjs} +4 -4
  108. package/dist/{platform-auth-recovery-DvAQ674F.mjs → platform-auth-recovery-DPK2Mvmo.mjs} +4 -4
  109. package/dist/{platform-cmd-BpUA19r_.mjs → platform-cmd-BLy5uCa-.mjs} +1 -1
  110. package/dist/{platform-cmd-dlSxrcQ7.mjs → platform-cmd-HS_FSthn.mjs} +7 -7
  111. package/dist/{platform-domain-DSO4eUEw.mjs → platform-domain-CHpcq_qg.mjs} +4 -4
  112. package/dist/{platform-lifecycle-CfcFygHb.mjs → platform-lifecycle-B6LUBwjS.mjs} +1 -1
  113. package/dist/{platform-lifecycle-BSvsyB_x.mjs → platform-lifecycle-D2RS7DE0.mjs} +239 -29
  114. package/dist/{platform-management-BMdyt667.mjs → platform-management-C-T0ch4y.mjs} +1 -1
  115. package/dist/{platform-management-CrP1XhVd.mjs → platform-management-d3ETv3Dw.mjs} +15 -15
  116. package/dist/{platform-plans-config-CgDiwflR.mjs → platform-plans-config-B7yJQKf7.mjs} +116 -32
  117. package/dist/{platform-recovery-CHWwXVZ6.mjs → platform-recovery-DS5CAsly.mjs} +2 -2
  118. package/dist/{platform-setup-BTQVbnTC.mjs → platform-setup-Casiffqj.mjs} +2 -2
  119. package/dist/{plugin-inference-g66Q1Mx9.mjs → plugin-inference-DZHmVe1f.mjs} +4 -4
  120. package/dist/{prepare-DXduEwQp.mjs → prepare-AVM4Hj3T.mjs} +10 -10
  121. package/dist/prepare-BSXKz6m8.mjs +1 -0
  122. package/dist/{prepare-DJYHjpzq.mjs → prepare-DMk8NAO-.mjs} +3 -3
  123. package/dist/{prerender-render-BN9Lmebs.mjs → prerender-render-BAdYhivW.mjs} +15 -2
  124. package/dist/prerender-render.d.mts +2 -0
  125. package/dist/prerender-render.mjs +1 -1
  126. package/dist/{project-cmd-Dfb1Sg8w.mjs → project-cmd-TQKAOTMV.mjs} +17 -17
  127. package/dist/{project-paths-G0yut6Zz.mjs → project-paths-CUhCPMpK.mjs} +33 -2
  128. package/dist/{project-team-BO2dyc7S.mjs → project-team-B1OKeb-T.mjs} +4 -4
  129. package/dist/{project-token-ByO2mEI2.mjs → project-token-RW_wpmN-.mjs} +4 -4
  130. package/dist/{project-tsconfig-nhnTWO_Y.mjs → project-tsconfig-MyRJgufB.mjs} +1 -1
  131. package/dist/{project-zero-trust-CoQfwRBR.mjs → project-zero-trust-TNc66p0_.mjs} +4 -4
  132. package/dist/{protocol-yxdHxFLN.mjs → protocol-IPSWHolJ.mjs} +233 -76
  133. package/dist/{protocol-xZMvWsrg.d.mts → protocol-YS3tbxWE.d.mts} +10 -3
  134. package/dist/{provision-CMH4-8ri.mjs → provision-BLdkpFT4.mjs} +1 -1
  135. package/dist/{provision-D5q-ptD3.mjs → provision-bgQTi5QZ.mjs} +2 -2
  136. package/dist/redirect-Dqb4fEc5.mjs +80 -0
  137. package/dist/{requests-CPOiDkjh.mjs → requests-Cj15-yrI.mjs} +3 -3
  138. package/dist/resolve-project-C5wC-Hoi.mjs +1 -0
  139. package/dist/{resolve-project-ClvLMTI9.mjs → resolve-project-Da3OgCU1.mjs} +1 -1
  140. package/dist/{rollback-BfCs2la4.mjs → rollback-CYnkng7B.mjs} +4 -4
  141. package/dist/{route-types-Cl3x0Q8B.mjs → route-types-C6eAOmOj.mjs} +4 -3
  142. package/dist/routes-stub.d.mts +4 -3
  143. package/dist/runtime/auth.d.mts +1 -1
  144. package/dist/runtime/auth.mjs +1 -1
  145. package/dist/runtime/better-auth-mysql.d.mts +1 -1
  146. package/dist/runtime/better-auth-mysql.mjs +1 -1
  147. package/dist/runtime/better-auth-pg.d.mts +1 -1
  148. package/dist/runtime/better-auth-pg.mjs +1 -1
  149. package/dist/runtime/better-auth.d.mts +1 -1
  150. package/dist/runtime/better-auth.mjs +1 -1
  151. package/dist/runtime/client-react.d.mts +1 -1
  152. package/dist/runtime/client-solid.d.mts +1 -1
  153. package/dist/runtime/client-svelte.d.mts +1 -1
  154. package/dist/runtime/client-vue.d.mts +1 -1
  155. package/dist/runtime/client.d.mts +1 -1
  156. package/dist/runtime/db.d.mts +6 -3
  157. package/dist/runtime/db.mjs +2 -2
  158. package/dist/runtime/env-public.d.mts +1 -1
  159. package/dist/runtime/env-public.mjs +53 -39
  160. package/dist/runtime/handler.d.mts +1 -1
  161. package/dist/runtime/live-client.d.mts +1 -1
  162. package/dist/runtime/live-server.mjs +1 -1
  163. package/dist/runtime/live.d.mts +1 -1
  164. package/dist/runtime/live.mjs +1 -1
  165. package/dist/runtime/routing.d.mts +8 -3
  166. package/dist/runtime/routing.mjs +164 -23
  167. package/dist/runtime/validator.d.mts +1 -1
  168. package/dist/runtime/ws-server.d.mts +3 -3
  169. package/dist/runtime/ws-server.mjs +1 -1
  170. package/dist/runtime/ws.d.mts +1 -1
  171. package/dist/{scan-L8OSv1f7.mjs → scan-4YOxDaw2.mjs} +230 -29
  172. package/dist/{secret-CuI6LTpD.mjs → secret-BSf7dgg_.mjs} +6 -6
  173. package/dist/{skills-BBO9wMjB.mjs → skills-CoBB9_Ao.mjs} +1 -1
  174. package/dist/{ast-bindings-BkivMJIo.mjs → static-exports-DFkzL-NX.mjs} +96 -33
  175. package/dist/{subcommand-prompt-BZMnCA8T.mjs → subcommand-prompt-0yIARXf2.mjs} +2 -2
  176. package/dist/{types-agfx0alu.d.mts → types-IPut3_Yx.d.mts} +15 -1
  177. package/dist/url-DaehRGKR.mjs +106 -0
  178. package/dist/{version-metadata-eUd6Ar_U.mjs → version-metadata-CeftH0fQ.mjs} +1 -1
  179. package/dist/{wrangler-k40T7XTQ.mjs → wrangler-B1gkT_wC.mjs} +3 -3
  180. package/dist/wrangler-fNGvPTlO.mjs +1 -0
  181. package/dist/{wrapper-BGsi_uHs.mjs → wrapper-xJ4LP5A7.mjs} +3 -3
  182. package/dist/{ws-DB8Feytg.d.mts → ws-C2zy0QBf.d.mts} +2 -2
  183. package/docs/guide/ai.md +2 -1
  184. package/docs/guide/app-types.md +1 -0
  185. package/docs/guide/auth.md +23 -27
  186. package/docs/guide/database/d1.md +18 -1
  187. package/docs/guide/database/mysql.md +1 -0
  188. package/docs/guide/database/postgresql.md +1 -0
  189. package/docs/guide/database.md +30 -27
  190. package/docs/guide/deployment.md +3 -2
  191. package/docs/guide/durable-state.md +1 -0
  192. package/docs/guide/edge/headers.md +4 -3
  193. package/docs/guide/edge/prerendering.md +6 -5
  194. package/docs/guide/edge/redirects.md +2 -1
  195. package/docs/guide/edge/revalidation.md +6 -1
  196. package/docs/guide/edge/rewrites.md +2 -1
  197. package/docs/guide/edge/static-assets.md +5 -0
  198. package/docs/guide/email/domains.md +1 -0
  199. package/docs/guide/email/receiving.md +3 -2
  200. package/docs/guide/email/sending.md +7 -4
  201. package/docs/guide/email.md +1 -0
  202. package/docs/guide/env-vars.md +4 -0
  203. package/docs/guide/index.md +1 -0
  204. package/docs/guide/jobs.md +1 -0
  205. package/docs/guide/kv.md +1 -0
  206. package/docs/guide/live.md +2 -1
  207. package/docs/guide/pages-routing/actions-and-forms.md +58 -22
  208. package/docs/guide/pages-routing/errors.md +109 -0
  209. package/docs/guide/pages-routing/head.md +45 -1
  210. package/docs/guide/pages-routing/islands.md +4 -1
  211. package/docs/guide/pages-routing/layouts.md +4 -1
  212. package/docs/guide/pages-routing/loaders.md +4 -1
  213. package/docs/guide/pages-routing/markdown.md +6 -4
  214. package/docs/guide/pages-routing/overview.md +16 -20
  215. package/docs/guide/pages-routing/view-transitions.md +1 -0
  216. package/docs/guide/platform/administration/access.md +1 -0
  217. package/docs/guide/platform/administration/connected-apps.md +13 -2
  218. package/docs/guide/platform/administration/email.md +1 -0
  219. package/docs/guide/platform/administration/operations.md +1 -0
  220. package/docs/guide/platform/administration/plans.md +35 -1
  221. package/docs/guide/platform/administration/projects.md +16 -1
  222. package/docs/guide/platform/administration/zero-trust.md +1 -0
  223. package/docs/guide/platform/development/local.md +1 -0
  224. package/docs/guide/platform/development/runtime.md +1 -0
  225. package/docs/guide/platform/development/schema-ci.md +1 -0
  226. package/docs/guide/platform/installation/ci.md +1 -0
  227. package/docs/guide/platform/installation/credentials.md +12 -9
  228. package/docs/guide/platform/installation/domains.md +1 -0
  229. package/docs/guide/platform/installation/first-deployment.md +1 -0
  230. package/docs/guide/platform/installation/maintenance.md +8 -1
  231. package/docs/guide/platform/installation/prerequisites.md +1 -0
  232. package/docs/guide/platform/installation/setup.md +9 -7
  233. package/docs/guide/platform/installation/uninstall.md +1 -0
  234. package/docs/guide/platform-administration.md +1 -0
  235. package/docs/guide/platform-development.md +1 -0
  236. package/docs/guide/project-collaboration.md +1 -0
  237. package/docs/guide/queues.md +3 -0
  238. package/docs/guide/quickstart.md +3 -2
  239. package/docs/guide/remote-dev.md +1 -0
  240. package/docs/guide/sandboxes.md +1 -0
  241. package/docs/guide/self-hosted-platform.md +1 -0
  242. package/docs/guide/server-routing.md +3 -2
  243. package/docs/guide/sse.md +2 -1
  244. package/docs/guide/ssg.md +18 -6
  245. package/docs/guide/ssr.md +1 -0
  246. package/docs/guide/storage.md +2 -1
  247. package/docs/guide/testing.md +64 -0
  248. package/docs/guide/type-safety.md +24 -21
  249. package/docs/guide/typed-fetch.md +1 -0
  250. package/docs/guide/websockets.md +1 -0
  251. package/docs/index.md +1 -0
  252. package/docs/integrations/agents.md +1 -0
  253. package/docs/integrations/cloudflare.md +7 -2
  254. package/docs/integrations/frameworks/analog.md +1 -0
  255. package/docs/integrations/frameworks/astro.md +1 -0
  256. package/docs/integrations/frameworks/nuxt.md +2 -1
  257. package/docs/integrations/frameworks/overview.md +1 -0
  258. package/docs/integrations/frameworks/react-router.md +1 -0
  259. package/docs/integrations/frameworks/sveltekit.md +1 -0
  260. package/docs/integrations/frameworks/tanstack-start.md +1 -0
  261. package/docs/integrations/hono.md +22 -0
  262. package/docs/integrations/nodejs-bun-deno.md +5 -4
  263. package/docs/reference/api/auth.md +23 -4
  264. package/docs/reference/api/client.md +1 -0
  265. package/docs/reference/api/database.md +24 -1
  266. package/docs/reference/api/deploy.md +4 -0
  267. package/docs/reference/api/durable.md +1 -0
  268. package/docs/reference/api/env.md +1 -0
  269. package/docs/reference/api/handlers.md +1 -0
  270. package/docs/reference/api/pages.md +38 -16
  271. package/docs/reference/api/plugin.md +1 -0
  272. package/docs/reference/api/resources.md +2 -1
  273. package/docs/reference/api/rewrites.md +9 -4
  274. package/docs/reference/api/types.md +1 -0
  275. package/docs/reference/api.md +2 -1
  276. package/docs/reference/cli/auth.md +1 -0
  277. package/docs/reference/cli/database.md +1 -0
  278. package/docs/reference/cli/deploy.md +5 -2
  279. package/docs/reference/cli/domains.md +1 -0
  280. package/docs/reference/cli/email.md +1 -0
  281. package/docs/reference/cli/generate.md +1 -0
  282. package/docs/reference/cli/github.md +1 -0
  283. package/docs/reference/cli/platform-config.md +4 -3
  284. package/docs/reference/cli/platform-email.md +1 -0
  285. package/docs/reference/cli/platform-installation.md +1 -0
  286. package/docs/reference/cli/platform-operations.md +1 -0
  287. package/docs/reference/cli/platform-users.md +71 -1
  288. package/docs/reference/cli/platform-zero-trust.md +1 -0
  289. package/docs/reference/cli/platform.md +1 -0
  290. package/docs/reference/cli/project.md +1 -0
  291. package/docs/reference/cli/secrets.md +1 -0
  292. package/docs/reference/cli/setup.md +1 -0
  293. package/docs/reference/cli.md +3 -0
  294. package/docs/reference/config.md +8 -3
  295. package/docs/reference/resource-inference.md +1 -0
  296. package/docs/reference/structure.md +1 -0
  297. package/package.json +25 -25
  298. package/skills/void/SKILL.md +3 -1
  299. package/dist/action-key-XtKKbbsi.mjs +0 -25
  300. package/dist/client-BAxLpSKv.mjs +0 -1
  301. package/dist/deploy-DEZkUS77.mjs +0 -2
  302. package/dist/discover-1DJD4YXD.mjs +0 -1
  303. package/dist/gen-C6iknRdI.mjs +0 -1
  304. package/dist/help-C_cqTByy.mjs +0 -1
  305. package/dist/load-user-env-CSwdofj0.mjs +0 -48
  306. package/dist/login-C4q1S-5b.mjs +0 -1
  307. package/dist/migrate-CVBsSFhC.mjs +0 -1
  308. package/dist/operator-cmd-DnaCnCSP.mjs +0 -1
  309. package/dist/output-CNsMDEd2.mjs +0 -1
  310. package/dist/platform-args-B7-wQ0_B.mjs +0 -1
  311. package/dist/prepare-Bx4a8cb1.mjs +0 -1
  312. package/dist/resolve-project-BALVa9q0.mjs +0 -1
  313. package/dist/url-CuoEn0o3.mjs +0 -43
  314. package/dist/wrangler-R3kMdJfw.mjs +0 -1
@@ -1,4 +1,5 @@
1
1
  ---
2
+ description: 'Carry types from your database schema through route handlers and page loaders to the UI.'
2
3
  outline: deep
3
4
  ---
4
5
 
@@ -136,7 +137,7 @@ The `action()` helper gets the same type checking. See [Actions & Forms](./pages
136
137
 
137
138
  ## Typed URLs and Navigation
138
139
 
139
- Use `routeUrl()` from `void/routes` to build URLs from your app's page, HTTP, and WebSocket route patterns. For a page at `pages/users/[id].tsx`, `.vue`, or `.svelte`, the pattern is `/users/[id]`:
140
+ To link to a user's profile, pass its route pattern and ID to `routeUrl()`:
140
141
 
141
142
  ```ts
142
143
  import { routeUrl } from 'void/routes';
@@ -149,9 +150,11 @@ const url = routeUrl('/users/[id]', {
149
150
  // /users/42?tab=activity#details
150
151
  ```
151
152
 
152
- Your editor autocompletes route patterns and parameter names. TypeScript checks that the route exists and all required parameters are supplied. Parameter values accept strings or numbers; Void encodes them for the URL. Query keys are chosen by your app, and values can be strings, numbers, booleans, or arrays of those values. Arrays become repeated query parameters; `null` and `undefined` values are omitted.
153
+ TypeScript checks the route and required parameter names. Patterns follow your filenames: `pages/users/[id].tsx`, `.vue`, or `.svelte` uses `/users/[id]`.
153
154
 
154
- Use bracket patterns with `routeUrl()`, typed `fetch()`, WebSocket `connect()`, page actions, and `useParams()`.
155
+ Parameters accept strings or numbers and are URL-encoded for you. Query values can be strings, numbers, booleans, or arrays. Arrays become repeated keys; `null` and `undefined` values are omitted.
156
+
157
+ The same bracket patterns work with typed `fetch()`, WebSocket `connect()`, page actions, and `useParams()`.
155
158
 
156
159
  Pass the returned string to `Link`, a plain `<a>`, or `c.redirect()`. For programmatic navigation and `c.rewrite()`, you can pass a destination object directly:
157
160
 
@@ -166,7 +169,7 @@ const profile = {
166
169
  } satisfies RouteDestination;
167
170
  ```
168
171
 
169
- Destination objects use the same parameter checking and URL encoding as `routeUrl()`. See [Pages Routing](./pages-routing/overview.md#typed-navigation) for links and router methods, and [Rewrites](../reference/api/rewrites.md#c-rewrite-destination) for server navigation.
172
+ Destination objects check and encode parameters just like `routeUrl()`. See [Pages Routing](./pages-routing/overview.md#typed-navigation) for client navigation and [Rewrites](../reference/api/rewrites.md#c-rewrite-destination) for server navigation.
170
173
 
171
174
  For a catch-all page such as `pages/files/[...path].tsx`, `.vue`, or `.svelte`, use `/files/[...path]` and pass the full path as one value:
172
175
 
@@ -184,7 +187,7 @@ routeUrl('/files/[...]', { params: { '*': 'docs/get started' } });
184
187
 
185
188
  ### Page params
186
189
 
187
- Pass a page's URL pattern as the type argument of `useParams()` to type the params it reads. For a page at `pages/users/[id].tsx`, `.vue`, or `.svelte`, the pattern is `/users/[id]`:
190
+ Pass the current page's pattern to `useParams()` to get typed parameters:
188
191
 
189
192
  ::: code-group
190
193
 
@@ -229,9 +232,9 @@ useParams<'/userz/[id]'>(); // Type error: no page matches
229
232
 
230
233
  :::
231
234
 
232
- The pattern must be one of your pages; HTTP and WebSocket routes are not accepted. A catch-all page such as `pages/files/[...path].tsx`, `.vue`, or `.svelte` gives `{ path: string }`. An unnamed catch-all (`[...].tsx`, `[...].vue`, or `[...].svelte`) has no params.
235
+ Use a page pattern, rather than an HTTP or WebSocket route. Named catch-alls such as `/files/[...path]` return `{ path: string }`; unnamed catch-alls have no named params.
233
236
 
234
- The pattern is checked by TypeScript only. Pass the pattern of the page the component renders in; without a pattern, `useParams()` returns `Record<string, string>`.
237
+ The type argument doesn't change which page is read. Without it, `useParams()` returns `Record<string, string>`.
235
238
 
236
239
  On the server, `c.req.param('slug')` accepts any name. Read the params object through `PageParams` so a missing or misspelled name is a type error:
237
240
 
@@ -243,7 +246,7 @@ const { slug } = c.req.param() as PageParams<'/posts/[slug]'>;
243
246
 
244
247
  ### Prerender paths
245
248
 
246
- On a dynamic page, annotate `getPrerenderPaths()` with `PageParams` for that page's URL pattern. Each returned object must then include the page's params, and a missing or misspelled key is a type error. Void does not infer this type from the filename, so the check applies only when the annotation is present:
249
+ Annotate `getPrerenderPaths()` with `PageParams` to check that every path includes the page's required parameters:
247
250
 
248
251
  ```ts
249
252
  // pages/blog/[slug].server.ts
@@ -254,9 +257,9 @@ export async function getPrerenderPaths(): Promise<PageParams<'/blog/[slug]'>[]>
254
257
  }
255
258
  ```
256
259
 
257
- In custom SSR mode the function returns full path strings, so annotate it as `Promise<string[]>`. See [Edge Prerendering](./edge/prerendering.md#dynamic-pages-with-params) and [Static Site Generation](./ssg.md#per-page-overrides).
260
+ Void doesn't infer this return type from the filename; include the annotation to catch missing or misspelled keys. Custom SSR returns full paths instead, typed as `Promise<string[]>`. See [Edge Prerendering](./edge/prerendering.md#dynamic-pages-with-params) and [Static Site Generation](./ssg.md#per-page-overrides).
258
261
 
259
- `routing.prerender` is a list of plain strings. Annotate the array with `satisfies RouteUrl[]` so each path has to match a route. The check applies when [`routing.typedRoutes`](../reference/config.md#routing-typedroutes) is on; otherwise `RouteUrl` is `string`:
262
+ For `routing.prerender`, use `satisfies RouteUrl[]` to check paths when [`routing.typedRoutes`](../reference/config.md#routing-typedroutes) is enabled:
260
263
 
261
264
  ```ts
262
265
  // void.config.ts
@@ -270,7 +273,7 @@ export default defineConfig({
270
273
 
271
274
  ### Checked URL strings
272
275
 
273
- [`routing.typedRoutes`](../reference/config.md#routing-typedroutes) checks plain URL strings in `Link`'s `href`, `router.visit()`, `router.prefetch()`, `router.flush()`, `c.rewrite()`, `c.redirect()`, `revalidate({ paths })`, `connectEventStream()`, `connectLiveStream()`, and `useIslandForm()`'s `post()`, `put()`, `patch()`, `delete()`, and `submit()`. Apps created with `void init` have it on. To turn it on in an existing app:
276
+ Enable [`routing.typedRoutes`](../reference/config.md#routing-typedroutes) to catch misspelled URLs in links, router calls, redirects, rewrites, cache revalidation, island forms, and stream clients. Apps created with `void init` already have it enabled. For an existing app:
274
277
 
275
278
  ```ts
276
279
  // void.config.ts
@@ -335,11 +338,13 @@ import { routeUrl } from 'void/routes';
335
338
 
336
339
  :::
337
340
 
338
- Links can also point to the current page (`?page=2`, `#comments`) and to `http://`, `https://`, `mailto:`, and `tel:` URLs. Relative paths such as `../settings` are rejected; use the absolute path. A fixed part with spaces or non-ASCII characters can be written as is (`/café menu`) or percent-encoded in uppercase, as `routeUrl()` returns it (`/caf%C3%A9%20menu`). A dynamic segment matches any text, including none, so `/users/[id]` also accepts `/users/` and `/users/42/edit`. With a root dynamic page such as `pages/[slug].tsx`, `.vue`, or `.svelte`, a protocol-relative URL like `//example.com` passes too.
341
+ Links also accept same-page queries and hashes (`?page=2`, `#comments`), and `http://`, `https://`, `mailto:`, and `tel:` URLs. Use absolute paths within your app; relative paths such as `../settings` are rejected. Static path segments accept raw text such as `/café menu` or uppercase percent encoding such as `/caf%C3%A9%20menu`.
342
+
343
+ String checks use TypeScript patterns, which don't validate individual dynamic segments. For example, `/users/[id]` also accepts `/users/` and `/users/42/edit`. A root dynamic page can accept `//example.com`. Prefer `routeUrl()` to encode parameters, and validate untrusted URLs at runtime.
339
344
 
340
- The [SSE](./sse.md#client) and [live stream](./live.md#subscribe-from-the-browser) clients, `connectEventStream()` and `connectLiveStream()`, take one of your routes or an `http://` or `https://` URL for a stream on another origin. They reject same-page, `mailto:`, `tel:`, and `ws://` URLs. Cast a stream URL that TypeScript can't check with `as RouteUrl`; the cast turns off the check for that URL.
345
+ The [SSE](./sse.md#client) and [live stream](./live.md#subscribe-from-the-browser) clients accept route URLs and external `http://` or `https://` URLs. Same-page links, `mailto:`, `tel:`, and `ws://` aren't stream destinations.
341
346
 
342
- `c.redirect()` uses the same check as links. With `routing.typedRoutes` on, the location is a route URL, a same-page query or hash (`?page=2`, `#comments`), or an `http://`, `https://`, `mailto:`, or `tel:` URL. A path that matches no route is a type error. An external `https://` literal needs no cast. A `URL` or a destination object is accepted too. Cast a string TypeScript cannot check, such as a URL from a provider SDK, your CMS, or a file in `public/`, with `as Href`:
347
+ `c.redirect()` accepts the same strings as links, plus a `URL` or destination object. For a URL from a provider SDK, your CMS, or `public/`, use `as Href` to skip the type check:
343
348
 
344
349
  ```ts
345
350
  import { routeUrl, type Href } from 'void/routes';
@@ -355,14 +360,14 @@ c.redirect(new URL('https://example.com/login'));
355
360
  c.redirect(dynamic as Href);
356
361
  ```
357
362
 
358
- The cast turns the check off, so cast only URLs you trust. Check a URL from the request, such as a `?redirectTo=` parameter, before redirecting to it. See [`c.redirect()`](../reference/api/rewrites.md#c-rewrite-destination).
363
+ Cast only URLs you trust. Validate request values such as `?redirectTo=` before redirecting; see [`c.redirect()`](../reference/api/rewrites.md#c-rewrite-destination) for an example.
359
364
 
360
365
  `void/routes` exports two types for these strings:
361
366
 
362
367
  - `RouteUrl`: the URL of one of your routes. `routeUrl()` returns it, and `c.rewrite()`, `useIslandForm()`, and `revalidate({ paths })` accept it. Annotate a `routing.prerender` list with it.
363
368
  - `Href`: anything a link or `c.redirect()` can point to: a `RouteUrl`, a same-page query or hash, or an external URL.
364
369
 
365
- Cast a string that TypeScript can't check, such as a path from your CMS or a file in `public/`. The cast turns the check off for that string:
370
+ Use these types for URLs you check at runtime:
366
371
 
367
372
  ::: code-group
368
373
 
@@ -412,9 +417,7 @@ import type { Href, RouteUrl } from 'void/routes';
412
417
 
413
418
  :::
414
419
 
415
- Restart the dev server or run `void prepare` after changing `routing.typedRoutes`.
416
-
417
- Route types update with the dev server. For CI or standalone typechecking, run `void prepare` and follow [Setup](#setup). The [API reference](../reference/api/types.md#void-routes) lists the URL helper and route types.
420
+ The dev server keeps route types up to date. After changing `routing.typedRoutes`, restart it or run `void prepare`. For CI and standalone typechecking, follow [Setup](#setup). See the [API reference](../reference/api/types.md#void-routes) for the URL helper and route types.
418
421
 
419
422
  ## What Gets Checked
420
423
 
@@ -468,7 +471,7 @@ Now `c.get("requestId")` returns `string` everywhere, with no assertion needed.
468
471
 
469
472
  ## Custom Binding Types
470
473
 
471
- On the Cloudflare target, Void generates types for bindings declared under `cloudflare` in `void.config.ts`. For example, configure a [Cloudflare rate limiter](https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/):
474
+ For native Cloudflare deployments, declare a binding in `void.config.ts` to give `c.env` its type. For example, add a [rate limiter](https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/):
472
475
 
473
476
  ```ts
474
477
  // void.config.ts
@@ -506,7 +509,7 @@ declare module 'void' {
506
509
  }
507
510
  ```
508
511
 
509
- The declaration can refine a generated binding or type a binding that is not declared in `cloudflare`. Fixed values and secrets declared in `env.ts` retain their schema types. These types apply to Void's `c.env`; use your framework's Cloudflare type setup when accessing bindings through `cloudflare:workers`.
512
+ Augmentation can refine a generated binding or add one you provide separately. Values declared in `env.ts` keep their schema types. These types apply to Void's `c.env`; for `cloudflare:workers`, use your framework's binding types.
510
513
 
511
514
  ## Setup
512
515
 
@@ -1,4 +1,5 @@
1
1
  ---
2
+ description: 'Call your API from the client with a typed fetch that checks paths, request bodies, and response types.'
2
3
  outline: deep
3
4
  ---
4
5
 
@@ -1,4 +1,5 @@
1
1
  ---
2
+ description: 'Send typed messages between the server and connected clients. Each route keeps its state in a Durable Object.'
2
3
  outline: deep
3
4
  ---
4
5
 
package/docs/index.md CHANGED
@@ -1,4 +1,5 @@
1
1
  ---
2
+ description: 'Build with Vite and deploy with Void: a CLI, platform, and full-stack SDK for apps on Cloudflare.'
2
3
  layout: home
3
4
  theme: dark
4
5
 
@@ -1,4 +1,5 @@
1
1
  ---
2
+ description: "Set up coding agents with void init, including project instructions and links to Void's docs and skills."
2
3
  outline: deep
3
4
  ---
4
5
 
@@ -1,4 +1,5 @@
1
1
  ---
2
+ description: 'Deploy to Cloudflare Workers. Void detects the resources your app uses, creates bindings, and publishes the Worker.'
2
3
  outline: deep
3
4
  ---
4
5
 
@@ -42,7 +43,7 @@ Add `void/env` to your TypeScript types:
42
43
  }
43
44
  ```
44
45
 
45
- This provides binding types and Workers runtime types. Custom bindings declared in `cloudflare` in `void.config.ts` are typed on `c.env` after `void prepare` or starting a dev server or build. See [Custom Binding Types](../guide/type-safety.md#custom-binding-types) to add RPC methods to service or Durable Object bindings.
46
+ This provides binding and Workers runtime types. For custom bindings in `void.config.ts`, run `void prepare` or start the dev server or build to type them on `c.env`. See [Custom Binding Types](../guide/type-safety.md#custom-binding-types) for RPC methods on service and Durable Object bindings.
46
47
 
47
48
  ### Available bindings
48
49
 
@@ -174,7 +175,11 @@ Set production server values with `void secret put <NAME>`. Void preserves exist
174
175
 
175
176
  ### Readiness and rollback
176
177
 
177
- Void normally verifies an uploaded version before sending it traffic. A Worker with workers.dev turned off and no route or Custom Domain has no URL Void can check, so that deploy skips the readiness check and activates the uploaded version. If readiness or trigger updates fail, it restores the previous deployment. If trigger updates fail and Void cannot restore the previous version's triggers, for example because another tool deployed it or it is an empty draft, the new version stays live and the error says which version is serving traffic. Finish or cancel any gradual rollout in Cloudflare before deploying through Void.
178
+ Void checks an uploaded version before sending it traffic. If the Worker has no public URL, because workers.dev is off and no route or Custom Domain is configured, Void activates it without a readiness check.
179
+
180
+ If readiness or trigger updates fail, Void restores the previous deployment. If trigger updates fail and the previous triggers can't be restored, such as after another tool's deployment or from an empty draft, the new version stays live. The error names the version serving traffic.
181
+
182
+ Finish or cancel gradual rollouts in Cloudflare before deploying through Void.
178
183
 
179
184
  For an existing Durable Object Worker that Cloudflare cannot stage, review the changes and use:
180
185
 
@@ -1,4 +1,5 @@
1
1
  ---
2
+ description: 'Add Void to an Analog app for resource detection, typed database queries, migrations, and deployment.'
2
3
  outline: deep
3
4
  ---
4
5
 
@@ -1,4 +1,5 @@
1
1
  ---
2
+ description: 'Add Void to an Astro app for resource detection, typed database queries, migrations, and deployment.'
2
3
  outline: deep
3
4
  ---
4
5
 
@@ -1,4 +1,5 @@
1
1
  ---
2
+ description: 'Add Void to a Nuxt app for resource detection, typed database queries, migrations, and deployment.'
2
3
  outline: deep
3
4
  ---
4
5
 
@@ -48,7 +49,7 @@ export default defineNuxtConfig({
48
49
 
49
50
  The `void/nitro` module gives Nuxt server routes your app's `void/db` and `@schema`. The top-level `alias` lets `nuxi typecheck` resolve `@schema`, because Nuxt also checks server routes with the app's types. `cloudflare.dev` gives the development server the bindings from Void's generated Cloudflare config; Nuxt runs it in development when `compatibilityDate` is `2025-07-15` or later.
50
51
 
51
- The database module supports Nitro 2 and Nitro 3 prereleases. Keep your Nuxt version's Cloudflare development configuration; Nitro 3 manages local Workers through its development runner.
52
+ The database module supports Nitro 2 and Nitro 3 prereleases. Use the Cloudflare development configuration for your Nuxt version; Nitro 3 uses its own Worker runner.
52
53
 
53
54
  ### 4. Create `void.config.ts`
54
55
 
@@ -1,4 +1,5 @@
1
1
  ---
2
+ description: "Keep your framework's routes and rendering, and use Void for databases, storage, jobs, and deployment."
2
3
  outline: deep
3
4
  ---
4
5
 
@@ -1,4 +1,5 @@
1
1
  ---
2
+ description: 'Add Void beside the React Router Vite plugin for databases, storage, and deployment, without a separate Cloudflare adapter.'
2
3
  outline: deep
3
4
  ---
4
5
 
@@ -1,4 +1,5 @@
1
1
  ---
2
+ description: 'Add Void to a SvelteKit app for resource detection, typed database queries, migrations, and deployment.'
2
3
  outline: deep
3
4
  ---
4
5
 
@@ -1,4 +1,5 @@
1
1
  ---
2
+ description: 'Add Void beside the TanStack Start Vite plugin for databases, storage, and deployment, without a separate Cloudflare adapter.'
2
3
  outline: deep
3
4
  ---
4
5
 
@@ -1,4 +1,5 @@
1
1
  ---
2
+ description: 'Void route handlers run on Hono. Add hono to your app when your code imports from it directly.'
2
3
  outline: deep
3
4
  ---
4
5
 
@@ -103,3 +104,24 @@ throw new HTTPException(404, { message: 'User not found' });
103
104
  ```
104
105
 
105
106
  For the full list of built-in middleware, see the [Hono documentation](https://hono.dev/docs/middleware/builtin).
107
+
108
+ ### Redirects
109
+
110
+ Return `c.redirect()` from a handler to redirect. From a shared helper, throw an `HTTPException` with the redirect response in `res`. This works in loaders, actions, and middleware, including client-side page visits:
111
+
112
+ ```ts
113
+ // lib/require-page-user.ts
114
+ import { HTTPException } from 'hono/http-exception';
115
+ import type { CloudContext } from 'void';
116
+ import { getUser } from 'void/auth';
117
+
118
+ export function requirePageUser(c: CloudContext) {
119
+ const user = getUser();
120
+ if (!user) {
121
+ throw new HTTPException(302, { res: c.redirect('/login') });
122
+ }
123
+ return user;
124
+ }
125
+ ```
126
+
127
+ After a mutation, use `303` for both the exception and `c.redirect('/login', 303)` so the browser follows with a GET.
@@ -1,4 +1,5 @@
1
1
  ---
2
+ description: 'Build a Void server for Node.js, Bun, or Deno, and run it on your own machine, in a container, or with another host.'
2
3
  outline: deep
3
4
  ---
4
5
 
@@ -163,9 +164,9 @@ This is useful for testing, embedding in Express/Fastify, or running in serverle
163
164
 
164
165
  ### Serving the client build from somewhere else
165
166
 
166
- By default, `app.js` serves the client build from `dist/client`, next to `dist/ssr`. To serve it from elsewhere, such as from inside a [single executable application](https://nodejs.org/api/single-executable-applications.html), pass an `ASSETS` object with a `fetch(request)` method in the env. Void then reads the client manifest, scripts, styles and `public/` files through it, and doesn't look for `dist/client`.
167
+ To embed your app in a [single executable](https://nodejs.org/api/single-executable-applications.html), pass an `ASSETS` object with a `fetch(request)` method to `app.fetch()`. Void uses it for the client manifest, scripts, styles, and public files instead of reading `dist/client`.
167
168
 
168
- This server reads the client build from a single executable's assets, stored under their URL paths (`/.vite/manifest.json`, `/assets/…`, and `public/` files):
169
+ For Node.js, store assets under their URL paths, including `/.vite/manifest.json`, `/assets/…`, and files copied from `public/`:
169
170
 
170
171
  ```ts
171
172
  import { getAsset } from 'node:sea';
@@ -193,9 +194,9 @@ const ASSETS = {
193
194
  serve({ fetch: (request, env) => app.fetch(request, { ...env, ASSETS }), port: 3000 });
194
195
  ```
195
196
 
196
- Keep the env the server passes in: on Node.js it carries the incoming request, which `getConnInfo()` reads.
197
+ Keep the server's existing `env` values when adding `ASSETS`, so `getConnInfo()` can read the incoming request.
197
198
 
198
- With Bun, `bun build --compile` embeds a file only when the code imports it with `{ type: 'file' }`. Listing `dist/client` files as extra entry points doesn't work, because Bun bundles JavaScript entry points as code. Client file names change with every build, so write the imports into a module after `vite build`, one per file in `dist/client`:
199
+ For Bun, import each client file with `{ type: 'file' }` so `bun build --compile` embeds it as an asset. Generate this module after each `vite build`, since filenames change with the build. Don't list client scripts as build entry points; Bun would bundle them as executable code:
199
200
 
200
201
  ```ts
201
202
  // client-files.ts, written after each `vite build`
@@ -1,4 +1,5 @@
1
1
  ---
2
+ description: 'Sessions, users, and auth clients from void/auth, plus the browser helpers in void/client.'
2
3
  outline: deep
3
4
  ---
4
5
 
@@ -68,7 +69,7 @@ import { getAuth } from 'void/auth';
68
69
  export const GET = defineHandler((c) => getAuth(c).handler(c.req.raw));
69
70
  ```
70
71
 
71
- Requires [authentication](../../guide/auth.md) to be enabled. Throws if no instance is available on the request. It is available to anonymous requests too; use `requireAuth(c)` when a route requires a signed-in user.
72
+ Enable [authentication](../../guide/auth.md) before calling this helper; it throws if no instance is available. Anonymous requests can use it too. Call `requireAuth(c)` separately to require a signed-in user.
72
73
 
73
74
  **Signature:**
74
75
 
@@ -76,9 +77,11 @@ Requires [authentication](../../guide/auth.md) to be enabled. Throws if no insta
76
77
  function getAuth(c: CloudContext): AuthInstance;
77
78
  ```
78
79
 
79
- ## `requireAuth(c)` {#requireauth-c}
80
+ ## `requireAuth(c, options?)` {#requireauth-c}
80
81
 
81
- Extracts the authenticated user from the request context. Throws a 401 `HTTPException` if no session is present.
82
+ Returns the authenticated user from the request context. Without `throwRedirect`, throws a 401 `HTTPException` if no session is present.
83
+
84
+ Use it without options in route handlers or actions when you want a plain-text `401`, not an error page:
82
85
 
83
86
  ```ts
84
87
  import { defineHandler } from 'void';
@@ -90,10 +93,26 @@ export const GET = defineHandler((c) => {
90
93
  });
91
94
  ```
92
95
 
96
+ For protected pages, pass `throwRedirect` to [redirect unauthenticated visitors to login](../../guide/auth.md#protect-a-server-route):
97
+
98
+ ```ts
99
+ import { defineHandler } from 'void';
100
+ import { requireAuth } from 'void/auth';
101
+
102
+ export const loader = defineHandler((c) => {
103
+ const user = requireAuth(c, { throwRedirect: '/login' });
104
+ return { email: user.email };
105
+ });
106
+ ```
107
+
108
+ `throwRedirect` works in loaders, actions, and middleware. When signed out, it throws a redirect with status `302` for GET/HEAD requests or `303` for other methods, stopping execution. When signed in, it returns the user normally.
109
+
110
+ The destination is application-controlled.
111
+
93
112
  **Signature:**
94
113
 
95
114
  ```ts
96
- function requireAuth(c: CloudContext): AuthUser;
115
+ function requireAuth(c: CloudContext, options?: { throwRedirect?: string }): AuthUser;
97
116
  ```
98
117
 
99
118
  ## `AuthUser` {#authuser}
@@ -1,4 +1,5 @@
1
1
  ---
2
+ description: 'Call your routes from client code with a typed fetch. Paths and response types come from the generated route map.'
2
3
  outline: deep
3
4
  ---
4
5
 
@@ -1,4 +1,5 @@
1
1
  ---
2
+ description: 'Query D1, PostgreSQL, or MySQL with the Drizzle client from void/db, and seed data from a script.'
2
3
  outline: deep
3
4
  ---
4
5
 
@@ -36,6 +37,8 @@ import { createDb } from 'void/db';
36
37
  const db = createDb(env.MY_OTHER_DB);
37
38
  ```
38
39
 
40
+ For a fresh D1 read, pass `{ session: 'first-primary' }` and create the client inside the request. The default, `'first-unconstrained'`, allows the first query to use a replica. Both keep your schema and query types. See [Read replication](../../guide/database/d1.md#read-replication).
41
+
39
42
  For PostgreSQL and MySQL projects, pass a connection string.
40
43
 
41
44
  ```ts
@@ -48,7 +51,10 @@ const db = createDb('postgres://user:password@host:5432/app');
48
51
 
49
52
  ```ts
50
53
  // D1
51
- function createDb(d1: D1Database): DrizzleD1Database<Schema>;
54
+ function createDb(
55
+ d1: D1Database,
56
+ options?: { session?: D1SessionConstraint },
57
+ ): DrizzleD1Database<Schema>;
52
58
 
53
59
  // PostgreSQL
54
60
  function createDb(connectionString: string): NodePgDatabase<Schema>;
@@ -67,6 +73,23 @@ import { db, eq, and, or, desc, like, inArray, sql } from 'void/db';
67
73
 
68
74
  **Full list:** `sql`, `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `and`, `or`, `not`, `desc`, `asc`, `like`, `ilike`, `notLike`, `inArray`, `notInArray`, `isNull`, `isNotNull`, `between`, `notBetween`, `exists`, `notExists`, `count`, `sum`, `avg`, `min`, `max`.
69
75
 
76
+ Use the exported Drizzle types `SQL`, `SQLWrapper`, `AnyColumn`, and `BatchItem` to type query helpers and batches:
77
+
78
+ ```ts
79
+ import { posts } from '@schema';
80
+ import { db, sql, type BatchItem, type SQL, type SQLWrapper } from 'void/db';
81
+
82
+ function contains(column: SQLWrapper, text: string): SQL {
83
+ return sql`instr(${column}, ${text}) > 0`;
84
+ }
85
+
86
+ // D1 only: `db.batch()` takes at least one query.
87
+ const writes: [BatchItem<'sqlite'>, ...Array<BatchItem<'sqlite'>>] = [
88
+ db.update(posts).set({ published: true }).where(contains(posts.title, 'void')),
89
+ ];
90
+ await db.batch(writes);
91
+ ```
92
+
70
93
  ## Seeding {#seeding}
71
94
 
72
95
  Imported from `"void/seed"`.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: 'Prepare a built app, SPA, or static site for a managed platform deployment without platform credentials.'
3
+ ---
4
+
1
5
  # Deployment artifacts
2
6
 
3
7
  Use `void/deploy` from Node.js to prepare a built Void app, SPA, or static site for a managed platform deployment without platform credentials.
@@ -1,4 +1,5 @@
1
1
  ---
2
+ description: 'Persistent objects and typed WebSocket connections from void/durable.'
2
3
  outline: deep
3
4
  ---
4
5
 
@@ -1,4 +1,5 @@
1
1
  ---
2
+ description: 'Read validated environment values and binding types from void/env.'
2
3
  outline: deep
3
4
  ---
4
5
 
@@ -1,4 +1,5 @@
1
1
  ---
2
+ description: 'Define HTTP handlers, middleware, validation, scheduled jobs, queues, and rendering.'
2
3
  outline: deep
3
4
  ---
4
5