Skip to Content
DevelopersConfiguration

Configuration

OberonCMS starter apps are configured in three files under oberon/:

  • adapter.ts for Oberon runtime composition
  • config.ts for the server-side Oberon config and plugin list
  • client.config.tsx for client-safe Puck component configuration

File Structure

oberon/ ├── adapter.ts ├── client.config.tsx ├── config.ts ├── database.ts? # Present if database=custom └── send.ts? # Present if send=custom

adapter.ts

adapter.ts composes the Oberon runtime from your selected plugins and exports both:

  • adapter for server-side operations
  • handler for CMS/auth route handling

Basic Setup

oberon/adapter.ts
import "server-cli-only" import { initOberon } from "@oberoncms/core/adapter" import { config } from "./config" export const { adapter, handler } = initOberon(config)

config.ts

config.ts is the server-only Oberon config. It combines your client-safe component config with the ordered plugin list used by both Runtime composition and Oberon bootstrap.

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 tailwindPlugin } from "@oberoncms/plugin-tailwind" import { plugin as tursoPlugin } from "@oberoncms/plugin-turso" import { clientConfig } from "./client.config" export const config = defineConfig({ client: clientConfig, plugins: [developmentPlugin, tursoPlugin, tailwindPlugin, authPlugin], })

Plugin Order

Plugin order is significant. Generated starter apps place:

  • developmentPlugin first
  • database plugin after development
  • storage plugin after database
  • send plugin after storage
  • other runtime plugins after send
  • authPlugin last

client.config.tsx

client.config.tsx is the Oberon client config for your Puck components. Keep Oberon docs brief and use Puck as the primary reference for overlapping API surface.

Use the Puck docs for component fields, Puck components, root configuration, and layout: https://puckeditor.com/docs 

Oberon-specific divergences from Puck

  • OberonClientConfig requires version: 1
  • Each entry in components may include optional transforms
  • OberonComponent is a typed alias over Puck ComponentConfig
oberon/client.config.tsx
import { type OberonClientConfig, type OberonComponent } from "@oberoncms/core" const Text = { fields: { text: { type: "text" }, }, defaultProps: { text: "Welcome to OberonCMS", }, transforms: [(props) => ({ ...props })], render: ({ text }) => <div>{text}</div>, } satisfies OberonComponent export const clientConfig: OberonClientConfig = { version: 1, components: { Text, }, }

When in doubt, follow Puck docs first and only apply Oberon-specific additions listed above.

Environment Variables

Required keys depend on selected plugins. See plugin pages for exact variables. At minimum, generated starter apps include:

OBERON_SITE_URL=http://localhost:3000 EMAIL_FROM=noreply@example.com

The create-oberon-app CLI automatically generates a .env.local template with placeholders for your chosen plugins.

Last updated on