Skip to content
Built with

SDK Reference ​

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 ​

SectionStart with
GeneralProject structure, Resource inference
ConfigConfig reference
CLICLI overview, Deployment, Database
APIAPI 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
PageWhat it is for
Project StructureAn 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 InferenceThe SDK automatically detects which Cloudflare resources your project uses by scanning source files at startup.
ConfigUse void.config.ts to configure your app. For a guided introduction, start with What is the SDK?.
CLI Referencevoid is a local binary from the installed void package.
Project setupShows each Durable State and WebSocket definition's source file, inferred or explicit name, Worker class, and binding.
Connections and authenticationConnect a project to its deployment destination.
ProjectsShow deployments for the configured target.
DeploymentAuto-detects your project type and chooses the right pipeline. See Supported App Types and Deployment for details.
DatabaseApply 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 generationScaffold a Drizzle table, list and create routes, and a route to fetch one row by ID.
Secrets and environmentList 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 buildsDeploy-on-GitHub works from any SDK login — Google, GitHub, or other SSO.
Custom domainsAdd, check and remove custom domains for the saved deploy target.
EmailInspect email usage and manage the recipients a project is allowed to send to. See Email for the runtime API.
Platform managementSDK-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 installationFor a first installation, follow Install a Void Platform.
Platform configurationUse your administrator session for these commands. See Platform Management for platform selection, previews, and confirmation.
Platform users and projectsUse your administrator session for these commands. See Platform Management for platform selection, previews, and confirmation.
Project Zero TrustUse your administrator session for these commands. See Platform Management for platform selection, previews, and confirmation.
Platform operationsUse your administrator session for these commands. See Platform Management for platform selection, previews, and confirmation.
Platform emailUse your administrator session for these commands. See Platform Management for platform selection, previews, and confirmation.
API ReferenceUse this reference to find public imports, signatures, and return types. For setup and examples, start with the guides.
Plugin and configurationvoidPlugin() from 'void': the Vite plugins for routing, migrations and the Workers runtime, and their options.
Handlers and MiddlewareImported from 'void' or 'void/handler'.
RewritesURL rewrites re-dispatch a request at a different internal path without changing the browser's URL.
AuthenticationImported from 'void/auth'. Client-side helpers imported from 'void/client'.
Fetch ClientImported from 'void/client'.
Durable State and WebSocketsImported from 'void/durable'. See Durable State for the complete file convention and deployment support.
Deployment artifactsUse void/deploy from Node.js to prepare a built SDK app for a managed platform deployment without platform credentials.
Database and SeedingThe db export from 'void/db': a Drizzle ORM instance for D1, PostgreSQL or MySQL, plus seeding helpers.
Resource clientsImported from 'void/kv'.
TypesHono Context pre-typed with CloudEnv. This is the type of the c parameter in all route handlers and middleware.
Environment VariablesImported from 'void/env'.
Pages adaptersFramework adaptors for Pages Routing. Each adaptor provides a Vite plugin and client-side runtime.

Next steps ​

implemented.stream AI