Reference

Configuration

Every option in oke.config.ts — three environments (dev · test · prod), drivers, images, i18n, tenancy, privacy, db sync, topology, ports, and console.

Complete reference for oke.config.ts. Options below match defineConfig. Driver maps use three keys: dev · test · prod.

oke.config.ts
import { defineConfig } from "okengine/config";

export default defineConfig({
  // options below
});

The one rule

Pin drivers and images in oke.config.ts for dev · test · prod. We test on what we deploy: Docker-first local stack, PGLite for tests, same protocol ids in production.

Environments

KeyWhenTypical backends
devoke dev (Docker Compose)Same protocols as prod (Postgres, Redis, S3, SMTP, …)
testoke test / bun testPGLite for SQL; memory / frozen / console elsewhere
prodProduction deployShared durable backends

Missing dev pins fill from prod (fillDevFromProd). Only dev / test / prod keys are valid — rename local → dev and docker → prod if you still have the old maps.

Quick start

Pin drivers for three envs

Pin only the env keys that differ from the built-in defaults — omitted keys keep DRIVER_DEFAULTS. create-oke templates ship that sparse shape:

oke.config.ts
import { defineConfig } from "okengine/config";

export default defineConfig({
  drivers: {
    // Default vault.dev is "env"; pin the built-in store for Docker-first apps.
    vault: { dev: "vault" },
  },
});

Or use a string shorthand

A bare string (or { driver, … } object) expands to all three envs:

drivers: {
  signal: "redis", // → { dev: "redis", test: "redis", prod: "redis" }
},

Prefer an explicit { dev, test, prod } map (or a partial override) when test should differ from the default for that driver.

Run and test

Terminal
oke dev    # Docker Compose + host Bun · drivers.dev
oke test   # bun test · NODE_ENV=test · OKE_PGLITE_URL=memory://

Default driver maps

Built-in defaults (DRIVER_DEFAULTS) when a key is omitted:

Mapdevtestprod
store.sqlpostgrespglitepostgres
store.kvredismemoryredis
store.filess3memorys3
signalredismemoryredis
clockpostgresfrozenpostgres
journalpostgresmemorypostgres
vaultenvmemoryvault
channel.emailsmtpconsolesmtp
channel.sms— (opt-in)——
runsfilesmemoryfiles

store.index, channel.whatsapp / push, and ai have no single three-env default table — set them explicitly when you need them. drivers.decide defaults to { test: "mock" }. Unset dev and prod call the decider host. create-oke templates pin vault.dev: "vault" (built-in) because the default dev driver is env.

Driver keys and ids

KeyShapeDriver ids
store.sqlenv driver mappostgres · pglite · memory
store.kvenv driver mapmemory · redis
store.filesenv driver mapmemory · fs · s3
store.indexenv driver mapmemory · pgvector · meilisearch
signalenv driver mapmemory · redis (boot); postgres · nats fail loud until clients bind
clockenv driver mapmemory · postgres · file · frozen
journalenv driver mapmemory · file · postgres
vaultenv driver mapenv · vault · memory · managed
channel.emailenv driver mapconsole · smtp · resend · sndr · taqnyat-mail
channel.smsenv driver mapconsole · taqnyat · msegat · unifonic
channel.whatsappenv driver mapconsole · wa-cloud
channel.pushenv driver mapconsole · webpush · fcm
aienv driver mapmock · anthropic · openai-compatible · bedrock · vertex
decideenv driver mapmock in test when omitted. Unset dev and prod call the decider host.
runsenv driver mapmemory · files (Parquet + DuckDB at .oke/runs) · postgres · clickhouse
prodstring[]flat protocol list for the Manifest — nested maps are preferred

Safety rules

defineConfig rejects unsafe pins:

  • sqlite is removed — use postgres (dev/prod) or pglite (test).
  • drivers.store.sql.test must be pglite when set — real Postgres semantics in tests.

Rich driver objects

sql: {
  prod: { driver: "postgres", pool: { max: 20 }, replicas: ["postgres://ro-1/db"] },
},
FieldTypeMeaning
urlconnection stringOverrides the env-var resolution
pool{ max?, min? }max is the Bun.SQL pool size. Unset keeps 8. min is accepted and not applied
replicasstring[]Read-only flows use these URLs. Each replica opens its own pool at the same max

A store max of 20 does not share a pool another part of the process already opened at 8. Writes stay on the primary.

images

Nested pins by element role — vendor choice lives here, never in driver ids:

images: {
  store: {
    sql: "postgres:18-alpine",
    kv: "docker.dragonflydb.io/dragonflydb/dragonfly:v2.0.0",
    files: "rustfs/rustfs:1.0.0",
  },
  channel: { email: "axllent/mailpit:v1.31.2" },
  pgdog: "ghcr.io/pgdogdev/pgdog:v0.1.59",
  // proxy: "caddy:2-alpine",
},

Omitted image keys mean no container for that role. When both store.sql and pgdog are pinned, DATABASE_URL points at PgDog — see Store.

For store.kv, pin Dragonfly (default), Redis, or Valkey — driver id stays redis. { durable: true } KV lives in SQL (oke_kv on DATABASE_URL), not a second Redis image.

Compose does not manage AI inference — OpenRouter or BYO OKE_AI_URL (Models). For proxy, see Caddy, Traefik, or nginx.

i18n

OptionTypeDefaultMeaning
localesstring[]["en"] when omittedSupported locales
defaultstring"en" when omittedFallback locale (channel templates, fx.t)
dirrecord—Per-locale direction: "ltr" | "rtl"
i18n: { locales: ["en"], default: "en" },
// or with Arabic: { locales: ["en", "ar"], default: "en", dir: { ar: "rtl" } }

tenancy

oke.config.ts tenancy is isolation posture (how rows are separated). Identity — who the tenant is — is gate.auth.tenant on Gate.

OptionTypeMeaning
isolation"row" | "schema" | "database"How tenants are separated in the store
resolvestring | functionObservational resolver (isolation-only manifests)

privacy

Presence of this block turns CORE privacy tooling on in the Console — not a .plug() call.

privacy: {},

runs

Runs retention and redaction — not the same key as drivers.runs.

OptionTypeMeaning
keepstring | "forever"Delete Parquet partitions older than this (7d in dev, 30d in prod)
redactRecord<string, string>Field → retention duration; presence turns privacy on

db

Domain schema sync for oke db push | generate | migrate (Drizzle). Unrelated to oke schema generate.

OptionDefaultMeaning
autoPushtrueAuto-run db push on schema change under oke dev; forced off in prod
config"drizzle.config.ts"Path to the drizzle-kit config
declareautoschema.ts (file) if present, else schema/index.ts (folder). Set to override.
generatedautosrc/db/drizzle/index.ts. Set to override.
entrysrc/app.tsApp entry for collecting plugin table contributions

topology

ValueMeaning
"monolith"One process serves everything (default posture)
"services"Split deployment units derived from the Manifest

ports

OptionDefaultSurface
app6530Backend
console6533Console
mcp6535MCP

App options

These sit on oke({ ... }), not in oke.config.ts.

OptionDefaultMeaning
codeVersionunsetOpt-in durable stamp app:<version>. Unset checks nothing. A stored 0.23.1-style stamp is compatible and restamped. A different app: stamp fails the run with OKE1076.
maxRequestBodySize1048576Body cap in bytes. A route maxBodySize overrides it. Bun's listen backstop uses the same number.
cache.maxEntries10000Auto-cache entry cap.
cache.defaultTtlMs60000Auto-cache TTL when the flow does not set cache: "5m".
cache.autoonfalse turns automatic caching off. A flow can still opt in.

Postgres broadcast and live poll with lagMs, default 30000. That window is best-effort, not a gap-free cursor.

A write drops the auto-cache on every instance. With Redis configured, the notice is published on oke:cache:invalidate. Otherwise a Postgres app polls oke_cache_invalidations on its own one-second timer, including when startScheduler is false. One process does not broadcast. Before it skips that insert it reads oke_instances again, so a peer that registered during the last poll is still notified.

console

OptionTypeDefaultMeaning
prod.enabledboolean—Serve the Console in prod
prod.auth"required" | "optional" | "none"—Access requirement

Troubleshooting

Learn more

  • CLI — oke dev · oke test · oke db
  • Environment Variables — URL and secret resolution
  • Store — what the store drivers back
  • i18n — locale catalogs beyond the config block

Next

On this page