Configuration
An Oberon config combines component settings with an ordered list of plugins. Starter apps keep
these files in oberon/:
| File | Purpose |
|---|---|
client.config.tsx | Component settings that can run in the browser |
config.ts | Server-only configuration and plugins |
adapter.ts | Runtime initialization |
prebuild.ts | Database migrations and initial CMS data |
actions.ts | CMS actions for the selected framework |
send.ts | Generated email plugin |
database.ts | Generated database plugin, when you select custom |
Server configuration
This example uses Next.js and Turso:
import "server-cli-only"
import { defineConfig } from "@oberoncms/core"
import { authPlugin } from "@oberoncms/core/auth"
import { plugin as developmentPlugin } from "@oberoncms/plugin-development"
import { plugin as nextjsPlugin } from "@oberoncms/plugin-nextjs"
import { plugin as tursoPlugin } from "@oberoncms/plugin-turso"
import { clientConfig } from "./client.config"
import { plugin as sendPlugin } from "./send"
export const config = defineConfig({
client: clientConfig,
plugins: [developmentPlugin, tursoPlugin, sendPlugin, nextjsPlugin, authPlugin],
})For TanStack Start, use plugin from @oberoncms/plugin-tanstack instead of the Next.js plugin.
Select a send plugin for production email.
Plugin order
Later adapter hooks wrap earlier implementations. Bootstrap tasks run in list order. See Plugin shape for composition rules.
Generated apps use this order:
- Development plugin
- Database plugin
- Send plugin
- Framework plugin
- Auth plugin
If you add storage or Tailwind, put storage after the database and Tailwind before the framework plugin.
Runtime
initAdapter returns the composed Adapter. It does not return a route handler.
import "server-cli-only"
import { initAdapter } from "@oberoncms/core/adapter"
import { config } from "./config"
export const adapter = initAdapter(config)Create HTTP entrypoints with the framework’s route handler. The framework plugin supplies request headers, redirects, and auth cookie handling. The Next.js Plugin also caches reads. After Page creation, publication, or deletion, it revalidates that Page’s public, editor, and preview paths and refreshes the Page list without expiring unrelated Page reads.
Bootstrap
bootstrapOberon creates an Adapter for the bootstrap phase. It runs enabled plugin tasks in order.
It creates a welcome page if the database has no pages. It creates Site state if none exists.
import { bootstrapOberon } from "@oberoncms/core/adapter"
import { config } from "./config"
await bootstrapOberon(config)Bootstrap tasks are not Adapter methods. If a task fails, later tasks and CMS initialization do not run.
Components
Use OberonClientConfig for browser-safe settings. It requires version: 1 and permits optional
component transforms. See Components for an example. Use the
Puck documentation for fields, slots, and layouts.
Environment variables
The installer creates .env.local with the admin email, an auth secret, and development settings.
It does not supply production credentials. Set the variables required by
authentication and your selected plugins.
Turn off both development flags before deployment:
USE_DEVELOPMENT_DATABASE=false
USE_DEVELOPMENT_SEND=false