Skip to content
brought to you byVoidZero

Quickstart ​

Let’s build a small app with a /api/hello route, call it from the browser, and deploy it. If you already have a Vite app, you can start there.

Create an app ​

In an empty directory, install Void and run setup:

sh
npm install -D void
npx void init
sh
pnpm add -D void
pnpm void init
sh
yarn add -D void
yarn void init
sh
# bunx runs Void with the `node` on your PATH: use Node.js 24.22+ or 26.12+
bun add -D void
bunx void init
sh
vp add -D void
vpx void init

Choose your UI framework, a starter, and a deployment target. For this example, choose D1 if you want a database you can run locally. You can connect your Cloudflare account now or skip deployment setup until the app is running.

By default, setup installs Vite+ for the project and keeps your package manager and lockfile. With pnpm, pnpm create void my-app can create the directory and configure build permissions in one step.

If pnpm add reports ERR_PNPM_IGNORED_BUILDS, continue with pnpm void init. It writes the required permissions to pnpm-workspace.yaml.

Run locally ​

sh
npm run dev
sh
pnpm run dev
sh
yarn run dev
sh
bun run dev
sh
vpr dev

Open http://localhost:5173. In a Pages starter, pages/ contains your UI and companion .server.ts files contain its server loaders and actions. Loaders return data to page components as typed props.

Call a server route ​

Edit routes/api/hello.ts, or create it if your starter doesn't include it:

ts
import { defineHandler } from 'void';

export const GET = defineHandler(() => {
  return { message: 'Hello from Void' };
});

Open http://localhost:5173/api/hello. You should see {"message":"Hello from Void"}. Now call the same route from your client code.

ts
import { fetch } from 'void/client';

const { message } = await fetch('/api/hello');

Hover over message in your editor. TypeScript knows it’s a string because that’s what the handler returns. Try renaming it to greeting in the handler. TypeScript will point you to the client code that still reads message.

Database starters also include db/schema.ts. Its Drizzle schema defines your tables and query types; Void runs a local database and provisions one when you deploy.

Deploy ​

If you chose a target during setup:

sh
npx void deploy

If you skipped setup, select your Cloudflare account:

sh
npx void deploy --platform cloudflare

Void opens your browser to sign in when needed, builds the app, provisions resources, applies migrations, and prints the deployed URL. Later deploys use the saved target. See Deployment for team platforms, CI, and rollback.

Adding to an existing Vite app ​

Install Void and run void init with your package manager as shown above. Setup adds voidPlugin() to your Vite config and creates the remaining project files. If the config needs a manual edit, the CLI shows the change to make.

For a meta framework such as TanStack Start, React Router, or SvelteKit, follow its integration guide.

Next steps ​