Skip to content
Built with

Plugin and configuration ​

SDK Reference

voidPlugin() is the Vite plugin that turns a Vite project into an SDK app. It is a named export from "void".

On this pageAdd the plugin to vite.config.ts · Check the plugin options · See how project configuration is read

voidPlugin(options?) ​

A named export from "void". It returns an array of Vite plugins. They set up file-based routing, migrations and the Cloudflare Workers runtime. App settings come from void.config.ts. The optional options object controls the Vite and Cloudflare plugins.

ts
import { voidPlugin } from 'void';

export default defineConfig({
  plugins: [voidPlugin()],
});
OptionTypeDescription
persistTostringDirectory path for persisting local dev state (D1, KV, R2). Defaults to .void/ in the project root.
auxiliaryWorkersAuxiliaryWorkerConfig[]Additional workers to run inside the same Miniflare instance during dev. Passed through to @cloudflare/vite-plugin. Useful for running multiple workers that share bindings (e.g. a separate API worker alongside a dashboard).

Project configuration ​

defineConfig(config) ​

Import it from void/config in the root void.config.ts. It returns the config with editor completion and TypeScript checks. The SDK checks the result again on load, including values computed at runtime.

ts
import { defineConfig } from 'void/config';

export default defineConfig({
  cloudflare: { name: 'my-app' },
  routing: { revalidate: 60 },
});

See the config reference for all fields.

Next steps ​

implemented.stream AI