Skip to Content
DevelopersConfiguration

Configuration

An Oberon config combines component settings with an ordered list of plugins. Starter apps keep these files in oberon/:

FilePurpose
client.config.tsxComponent settings that can run in the browser
config.tsServer-only configuration and plugins
adapter.tsRuntime initialization
prebuild.tsDatabase migrations and initial CMS data
actions.tsCMS actions for the selected framework
send.tsGenerated email plugin
database.tsGenerated database plugin, when you select custom

Server configuration

This example uses Next.js and Turso:

oberon/config.ts
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:

  1. Development plugin
  2. Database plugin
  3. Send plugin
  4. Framework plugin
  5. 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.

oberon/adapter.ts
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.

oberon/prebuild.ts
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
Last updated on