Configuration
Full reference for the omniSvelte configuration in vite.config.ts.
Configuration
Breaking change in v0.2: Configuration moved from
svelte.config.jstovite.config.ts. If you were settingomnioptions insidesvelte.config.js, move them to theomniSvelte()plugin call instead. SvelteKit options now go under thekitnamespace insideomniSvelte().
In SvelteKit 3, configuration is passed directly to the omniSvelte() plugin in vite.config.ts.
Top-level shape
ts
// vite.config.ts
import { defineConfig } from 'vite';
import { omniSvelte } from 'omni-svelte/vite';
export default defineConfig({
plugins: [
omniSvelte({
database?: DatabaseConfig;
schema?: SchemaConfig;
auth?: AuthConfig;
logging?: { enabled: boolean };
cors?: { enabled: boolean };
analytics?: { enabled: boolean };
errorReporting?: { enabled: boolean };
kit?: KitConfig; // SvelteKit plugin options
})
]
});Omni-svelte options (database, schema, auth, etc.) are defined at the top level of the object passed to omniSvelte(). Standard SvelteKit options can still be configured under the kit namespace.
database
schema
Controls how omni-svelte discovers and generates code from your .schema.ts files.
auth
Configures Better-Auth.