Skip to content
Built with

Quickstart ​

Start

Create an SDK app, run it on your machine, call a server route, and deploy it. Already have a Vite app? Jump to Adding to an existing Vite app.

On this pageCreate a new app with void init · Run it locally with npm run dev · Deploy your first version

Create an app ​

Now you'll create the app. In an empty folder, type each command on its own:

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
bun add -D void
bunx void init

Example output: the install finishes, then void init asks you questions.

text
? UI framework …
? Starter …
? Deployment target …

If you see an error: EBADENGINE means your Node.js is too old. Run node -v and upgrade.

Pick a UI framework, a starter and a deployment target. Vite+ is the default build tool. D1 is a good first database. It runs locally with no separate server. Choose Cloudflare to deploy to your own account, or skip deploy setup for now.

You don't need to install Vite+ globally. Setup keeps your package-manager versions and lockfiles.

With pnpm, pnpm create void my-app also creates the folder and sets native build permissions.

Run locally ​

Now you'll start the local server.

sh
npm run dev

Example output:

text
  ➜  Local:   http://localhost:5173/

Open http://localhost:5173. In a Pages starter, pages/ holds your UI. Each companion .server.ts file holds that page's loaders and actions. Loaders pass data to components as typed props.

Call a server route ​

Now you'll add an API route and call it from the client.

Edit routes/api/hello.ts. Create it if your starter doesn't have it.

ts
import { defineHandler } from 'void';

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

Open http://localhost:5173/api/hello in your browser.

Example output:

text
{"message":"Hello from Void"}

Call the same route from client code with the SDK's typed fetch.

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

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

The file path sets the URL. The handler sets the response type. Rename message in the handler, and TypeScript flags the client code that needs to change.

Database starters also include db/schema.ts. Its Drizzle schema defines your tables and query types. The SDK runs a local database and creates a real one when you deploy.

Deploy ​

Now you'll put the app live.

Requires: a login

The first deploy opens your browser so you can sign in (Cloudflare or your team's platform). Nothing to paste; no token goes in your project.

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

Example output: a browser sign-in (first time only), then build and upload progress, then your live URL.

If you see an error: a sign-in or permission error means the browser login didn't finish. Run the same command again and complete the sign-in.

The deploy builds the app, creates resources and applies migrations. Then it prints the live URL. Later deploys reuse the saved target. For team platforms, CI and rollback, see Deployment.

Add the SDK to an existing Vite app ​

Now you'll add the SDK to a Vite app you already have.

Run the same install and void init commands as in Create an app. Setup adds voidPlugin() to your Vite config and creates the missing files. If your config needs a manual edit, the CLI shows the exact change.

Using TanStack Start, React Router or SvelteKit? Follow its integration guide instead.

If pnpm blocks build scripts ​

Now you'll allow the native packages the SDK needs.

sh
pnpm approve-builds

Example output: a list of packages. Approve esbuild, sharp and workerd.

Then set better-sqlite3: false under allowBuilds in pnpm-workspace.yaml. The SDK uses its own bundled binaries.

Next steps ​

implemented.stream AI