shiichan

Deploy Vite Apps to Cloudflare with Void: SDK, CLI, and Platform in One!

Hi, it's Shii-chan! Today I'm covering Void, a new tool introduced on the Cloudflare Blog.

Cloudflare Blog blog.cloudflare.com

What was announced?

The Cloudflare Blog introduced Void, an open-source SDK, CLI, and self-hosted platform for building full-stack Vite apps and deploying them to Cloudflare. It comes from VoidZero and is published as one npm package and Vite plugin.

npm install void

Why it matters

Void puts development and deployment to Cloudflare, including provisioning resources, into one flow.

What changes

Void has three parts:

  • Void SDK: a composable JavaScript SDK for server routes, typed data access, and client UI
  • Void CLI: provisions resources and deploys to Cloudflare or a Void Platform
  • Void Platform: a self-hostable shared deployment platform for teams

Dive Deep

Features highlighted in the post:

  • File-based API routing, pre-rendering, caching, and islands
  • End-to-end type safety from the database to the UI
  • Automatic resource inference: importing void/db gives you a local database in development and provisions D1 on void deploy, and importing void/ai sets up Cloudflare AI Gateway automatically
  • Support for React and Vue, and it works with Vinext, React Router, SvelteKit, Nuxt, TanStack Start, and Astro

Two commands are shown:

void connect {platform-url}
void deploy

void deploy builds with Vite, applies migrations, provisions resources, and deploys. On first run it prompts for a Cloudflare login. The post also says agents can use the CLI to debug requests, read logs, and analyze performance.

To set up a Platform you need:

  • A Cloudflare account with Workers for Platforms and R2 enabled
  • A PostgreSQL database
  • An account with a login provider
  • A domain for apps

The Platform is built on Workers for Platforms, Hono, Better Auth, and Cloudflare's new cf CLI, with user and project access control, resource limits, deployment inspection, and usage monitoring. The post doesn't mention pricing or the license.

Wrap-up

  • Void is an open-source SDK, CLI, and Platform for Vite apps
  • void deploy goes from build to provisioning to deployment
  • Importing void/db or void/ai provisions resources automatically
  • A self-hostable Platform is available for teams

This one is for anyone who wants to put full-stack Vite apps on Cloudflare!