SDK Reference
This zone gives exact answers for every config option, CLI command and runtime API. Learn with the guides in Build & Deploy. Come here to check details.
What you can look up
- Check an option name, type or default in
void.config.ts. - Find the right CLI command and its flags.
- Look up an import, its signature and what it returns.
Sections
| Section | Start with |
|---|---|
| General | Project structure, Resource inference |
| Config | Config reference |
| CLI | CLI overview, Deployment, Database |
| API | API overview, Plugin, Handlers |
Example
ts
// void.config.ts
import { defineConfig } from 'void/config';
export default defineConfig({
// options documented in /reference/config
});Every page in this zone
Show all 34 pages, in sidebar reading order
| Page | What it is for |
|---|---|
| Project Structure | An SDK app uses file-based conventions to define routes, pages, middleware, and more. All directories are optional, so you only need the pieces your app actually uses. |
| Resource Inference | The SDK automatically detects which Cloudflare resources your project uses by scanning source files at startup. |
| Config | Use void.config.ts to configure your app. For a guided introduction, start with What is the SDK?. |
| CLI Reference | void is a local binary from the installed void package. |
| Project setup | Shows each Durable State and WebSocket definition's source file, inferred or explicit name, Worker class, and binding. |
| Connections and authentication | Connect a project to its deployment destination. |
| Projects | Show deployments for the configured target. |
| Deployment | Auto-detects your project type and chooses the right pipeline. See Supported App Types and Deployment for details. |
| Database | Apply your Drizzle schema directly to the development database without creating migration files. D1 updates the local database; PostgreSQL and MySQL use DATABASEURL from .env. |
| Code generation | Scaffold a Drizzle table, list and create routes, and a route to fetch one row by ID. |
| Secrets and environment | List production secret names for the saved target. Secret values are never printed. Direct Cloudflare targets query the Worker named in void.config.ts; --project is hosted-only. |
| GitHub and builds | Deploy-on-GitHub works from any SDK login — Google, GitHub, or other SSO. |
| Custom domains | Add, check and remove custom domains for the saved deploy target. |
| Inspect email usage and manage the recipients a project is allowed to send to. See Email for the runtime API. | |
| Platform management | SDK-managed projects deploy to an explicitly selected platform. Join one with void connect. Connections are stored per API origin, and credentials are scoped to that origin. |
| Platform installation | For a first installation, follow Install a Void Platform. |
| Platform configuration | Use your administrator session for these commands. See Platform Management for platform selection, previews, and confirmation. |
| Platform users and projects | Use your administrator session for these commands. See Platform Management for platform selection, previews, and confirmation. |
| Project Zero Trust | Use your administrator session for these commands. See Platform Management for platform selection, previews, and confirmation. |
| Platform operations | Use your administrator session for these commands. See Platform Management for platform selection, previews, and confirmation. |
| Platform email | Use your administrator session for these commands. See Platform Management for platform selection, previews, and confirmation. |
| API Reference | Use this reference to find public imports, signatures, and return types. For setup and examples, start with the guides. |
| Plugin and configuration | voidPlugin() from 'void': the Vite plugins for routing, migrations and the Workers runtime, and their options. |
| Handlers and Middleware | Imported from 'void' or 'void/handler'. |
| Rewrites | URL rewrites re-dispatch a request at a different internal path without changing the browser's URL. |
| Authentication | Imported from 'void/auth'. Client-side helpers imported from 'void/client'. |
| Fetch Client | Imported from 'void/client'. |
| Durable State and WebSockets | Imported from 'void/durable'. See Durable State for the complete file convention and deployment support. |
| Deployment artifacts | Use void/deploy from Node.js to prepare a built SDK app for a managed platform deployment without platform credentials. |
| Database and Seeding | The db export from 'void/db': a Drizzle ORM instance for D1, PostgreSQL or MySQL, plus seeding helpers. |
| Resource clients | Imported from 'void/kv'. |
| Types | Hono Context pre-typed with CloudEnv. This is the type of the c parameter in all route handlers and middleware. |
| Environment Variables | Imported from 'void/env'. |
| Pages adapters | Framework adaptors for Pages Routing. Each adaptor provides a Vite plugin and client-side runtime. |