Skip to content
Oxide
Esc
navigateopen⌘Jpreview
On this page

Configuration

Choose how the app is built and where it lands - a Node server, or a self-hosted worker.

Option Default Notes
preset "fetch" "fetch" or "celld"
workerEntry src/server.ts Relative to project root
outDir dist Output root
clientDir client Must stay inside outDir
wrangler.name required if emitConfig
wrangler.compatibility_date required if emitConfig
wrangler.compatibility_flags - optional
wrangler.durable_objects - optional
wrangler.migrations - optional
wrangler.services - optional
wrangler.vars - optional
emitConfig true on celld Set false to skip wrangler.jsonc
actions "http" "ws" needs crossws; not with celld
actionHeaders - Static headers on the HTTP client

main is always ./server.js. assets is added only when index.html exists. Unknown wrangler keys fail at build time.

import const oxide: (options?: OxidejsOptions | undefined) => import("vite").Plugin<any> | import("vite").Plugin<any>[]oxide from "oxidejs/vite";

function oxide(options?: OxidejsOptions | undefined): import("vite").Plugin<any> | import("vite").Plugin<any>[]oxide({
  OxidejsOptions.preset?: OxidejsPreset | undefined
"fetch" (default) skips wrangler.jsonc and serves client assets. "celld" emits wrangler.jsonc.
preset
: "celld",
OxidejsOptions.wrangler?: OxidejsWranglerOptions | undefined
Wrangler config fields to merge into the generated wrangler.jsonc.
wrangler
: { OxidejsWranglerOptions.name: stringname: "my-app", OxidejsWranglerOptions.compatibility_date: stringcompatibility_date: "2026-01-01" },
});

preset

"fetch" or "celld". fetch serves static files from Node, copies public/ next to the client, and sets Cache-Control: immutable on hashed assets. celld writes a config for celld, a self-hosted alternative to Cloudflare Workers, and skips asset serving.

workerEntry

Default src/server.ts. Path to the server entry, relative to the project root. See Server entry.

outDir

Default dist. Root of the build output.

clientDir

Default client. Client subdirectory under outDir. Must stay inside the output root.

wrangler

Fields merged into the generated wrangler.jsonc when emitConfig is on. name and compatibility_date are required. Unknown keys fail at build time.

emitConfig

Defaults to on for "celld", off for "fetch". Set false to skip writing wrangler.jsonc.

actions

"http" (default) or "ws". WebSocket upgrades /_action. Install crossws. It does not work with preset: "celld".

import const oxide: (options?: OxidejsOptions | undefined) => import("vite").Plugin<any> | import("vite").Plugin<any>[]oxide from "oxidejs/vite";

function oxide(options?: OxidejsOptions | undefined): import("vite").Plugin<any> | import("vite").Plugin<any>[]oxide({
  OxidejsOptions.actions?: OxidejsActionTransport | undefined
Transport for `*.server.ts` stubs. Default: "http".
actions
: "ws",
});

actionHeaders

Static headers inlined into the shared HTTP action client. Ignored when actions is "ws". Functions cannot ship to the browser.

import const oxide: (options?: OxidejsOptions | undefined) => import("vite").Plugin<any> | import("vite").Plugin<any>[]oxide from "oxidejs/vite";

function oxide(options?: OxidejsOptions | undefined): import("vite").Plugin<any> | import("vite").Plugin<any>[]oxide({
  OxidejsOptions.actionHeaders?: OxidejsActionHeaders | undefined
Extra headers on the shared HTTP action client. Ignored when `actions` is "ws".
actionHeaders
: { authorization: stringauthorization: "Bearer x" },
});

Was this page helpful?