Skip to content

Configuration Files ​

Every Holo setting lives in a file in your project's config/ folder. This page lists each first-party config file, its options, and the default used when you leave an option out.

For an introduction to how config works, see Configuration.

How config files work ​

Each file exports one object, usually wrapped in its package's define...Config() helper for autocomplete:

ts
import { defineCacheConfig } from '@holo-js/cache'
import { env } from '@holo-js/config'

export default defineCacheConfig({
  default: env('CACHE_DRIVER', 'file'),
})
  • The file name is the config name: config/cache.ts is read with useConfig('cache').
  • .ts, .mts, .js, .mjs, .cts, and .cjs all work.
  • Every option is optional. Holo fills in the defaults below.
  • env('KEY', fallback) reads an environment variable. When the fallback is a number or boolean, the value is converted to that type ('true', '1', 'yes', 'on' become true). An empty value uses the fallback. A value that doesn't convert throws an error that names the variable.

Reading config in your code ​

ts
import { config, useConfig } from '@holo-js/config'

const app = useConfig('app')
const mailFrom = config('mail.from.email')

useConfig() returns a whole file or a nested value; config() takes a dot path. Both are fully typed, including your own config files.

Your own config files ​

Add any file to config/ and wrap it in defineConfig():

ts
import { defineConfig, env } from '@holo-js/config'

export default defineConfig({
  stripe: {
    secret: env('STRIPE_SECRET'),
  },
})
ts
const stripeSecret = config('services.stripe.secret')

app.ts ​

General app settings. Created by every new project.

ts
import { defineAppConfig, env } from '@holo-js/config'

export default defineAppConfig({
  name: env('APP_NAME', 'Blog'),
  key: env('APP_KEY'),
  url: env('APP_URL', 'http://localhost:3000'),
  timezone: env('APP_TIMEZONE', 'UTC'),
  debug: env('APP_DEBUG', false),
})
OptionDefaultDescription
name'Holo'Your app's name.
key''Secret key used to sign CSRF tokens and storage URLs, and to encrypt social login tokens. Generate it with npx holo key:generate.
url'http://localhost:3000'Public base URL of your app.
timezone'UTC'IANA timezone such as 'Europe/Berlin'. Holo sets the server process timezone to this value. Invalid names are rejected at startup.
debugfalseShows the messages of unexpected errors in SvelteKit responses. Nuxt's useHoloDebug() returns it. Next.js doesn't read it. Set APP_DEBUG=true in local .env files and leave it unset or false in production.
env'development''development', 'production', or 'test'.
plugins[]Active plugin package names. holo plugin:add and plugin:remove edit this list.
exceptions{}report(error, { capability, operation }) receives errors Holo catches in background work and your report() calls. dontReport lists error classes to skip. See Reporting errors.
pathssee belowWhere Holo looks for your files.

paths ​

KeyDefault
modelsserver/models
migrationsserver/db/migrations
seedersserver/db/seeders
factoriesserver/db/factories
observersserver/db/observers
commandsserver/commands
jobsserver/jobs
eventsserver/events
listenersserver/listeners
authorizationPoliciesserver/policies
authorizationAbilitiesserver/abilities
generatedSchema.holo-js/generated/schema.generated.ts

database.ts ​

Database connections. See Database: Getting Started and Multiple Connections.

ts
import { defineDatabaseConfig } from '@holo-js/db'
import { env } from '@holo-js/config'

export default defineDatabaseConfig({
  defaultConnection: env('DB_CONNECTION', 'main'),
  connections: {
    main: {
      driver: env('DB_DRIVER', 'postgres'),
      host: env('DB_HOST', '127.0.0.1'),
      port: env('DB_PORT', '5432'),
      username: env('DB_USERNAME', 'postgres'),
      password: env('DB_PASSWORD'),
      database: env('DB_DATABASE', 'blog'),
    },
  },
})
OptionDefaultDescription
defaultConnectionfirst connectionName of the connection used when you don't pick one.
connectionsone SQLite connectionNamed connections. A value can be an options object or a connection URL string.

Connection options:

OptionDescription
driver'sqlite', 'postgres', or 'mysql'.
urlConnection URL, or the file path for SQLite (new projects use ./storage/database.sqlite).
host, port, username, password, databaseServer connection details.
schemaPostgres schema.
ssltrue, or an options object passed to the driver.
maxMaximum pool size.
connectionTimeoutMillisHow long to wait for a connection.
idleTimeoutMillisHow long an idle pooled connection stays open.
concurrency.maxConcurrentQueriesMaximum queries running at once.
concurrency.queueLimitMaximum queries waiting for a slot.
loggingLog queries.
security.allowUnsafeRawSqlAllow raw SQL that Holo would otherwise reject.
security.debugSqlInLogsInclude SQL text in logs.

redis.ts ​

Shared Redis connections. Queue, cache, session, rate limiting, and broadcast scaling refer to these by name. Created when you install a Redis-backed driver.

ts
import { env } from '@holo-js/config'
import { defineRedisConfig } from '@holo-js/kernel'

export default defineRedisConfig({
  default: env('REDIS_CONNECTION', 'default'),
  connections: {
    default: {
      url: env('REDIS_URL') || undefined,
      host: env('REDIS_HOST', '127.0.0.1'),
      port: env('REDIS_PORT', 6379),
      username: env('REDIS_USERNAME'),
      password: env('REDIS_PASSWORD'),
      db: env('REDIS_DB', 0),
    },
  },
})
OptionDefaultDescription
default'default'Connection used when a feature doesn't name one.
connectionsone connection to 127.0.0.1:6379, db 0Named connections.

Connection options: url (redis:// or rediss://), clusters (a list of { host, port } or { url } nodes), socketPath, host, port, username, password, db. When url is set it wins; otherwise clusters is used if present; otherwise host and port.

queue.ts ​

Queue connections. See Queues and Drivers and Tables.

ts
import { defineQueueConfig } from '@holo-js/queue'
import { env } from '@holo-js/config'

export default defineQueueConfig({
  default: env('QUEUE_CONNECTION', 'redis'),
  failed: false,
  connections: {
    redis: {
      driver: 'redis',
      queue: 'default',
      retryAfter: 90,
      blockFor: 5,
    },
  },
})
OptionDefaultDescription
default'sync'Default connection name.
faileddatabase store, failed_jobs tableWhere failed jobs are stored, or false to not store them. Options: driver: 'database', connection (default 'default'), table (default 'failed_jobs').
connectionsone sync connectionNamed connections.

Connection options by driver:

DriverOptions
syncqueue (default 'default'). Runs jobs immediately, no worker needed.
redisconnection (a config/redis.ts name), queue (default 'default'), retryAfter (seconds, default 90), blockFor (seconds, default 5).
databaseconnection (database connection, default 'default'), table (default 'jobs'), queue (default 'default'), retryAfter (seconds, default 90), sleep (seconds, default 1).

cache.ts ​

Cache stores. See Cache and Cache Drivers.

ts
import { defineCacheConfig } from '@holo-js/cache'
import { env } from '@holo-js/config'

export default defineCacheConfig({
  default: env('CACHE_DRIVER', 'file'),
  prefix: env('CACHE_PREFIX', ''),
  drivers: {
    file: {
      driver: 'file',
      path: './storage/framework/cache/data',
    },
    redis: {
      driver: 'redis',
    },
  },
})
OptionDefaultDescription
default'file'Default store name.
prefix''Prefix added to every key. Each store can override it.
driversfile and memory storesNamed stores.

Store options by driver:

DriverOptions
filepath (default ./storage/framework/cache/data), prefix.
memorymaxEntries (default 10000), prefix. Lives in one process only.
redisconnection (default 'default'), prefix.
databaseconnection (default 'default'), table (default 'cache'), lockTable (default 'cache_locks'), prefix. Run npx holo cache:table to create the tables.

storage.ts ​

File storage disks. See File Storage and Amazon S3.

ts
import { defineStorageConfig } from '@holo-js/storage'
import { env } from '@holo-js/config'

export default defineStorageConfig({
  defaultDisk: env('STORAGE_DEFAULT_DISK', 'local'),
  disks: {
    local: {
      driver: 'local',
      root: './storage/app',
    },
    public: {
      driver: 'public',
      root: './storage/app/public',
      visibility: 'public',
    },
  },
})
OptionDefaultDescription
defaultDisk'local'Disk used by Storage when you don't name one. Must exist in disks.
routePrefix'/storage'URL prefix that serves files from public disks.
diskslocal and publicNamed disks. Your disks are merged with the defaults.

Disk options:

OptionDriversDescription
driverall'local', 'public', or 's3'.
rootallFolder (local) or key prefix (S3). Local default ./storage/app, public default ./storage/app/public.
visibilityall'private' or 'public'.
urlallPublic base URL for files on this disk.
bucket, region, endpoints3Bucket details. Set endpoint for S3-compatible services.
accessKeyId, secretAccessKey, sessionTokens3Credentials.
forcePathStyleEndpoints3Use path-style URLs (needed by MinIO and some other services).

mail.ts ​

Mailers. See Mail and Mail Drivers.

ts
import { defineMailConfig } from '@holo-js/mail'
import { env } from '@holo-js/config'

export default defineMailConfig({
  default: env('MAIL_MAILER', 'preview'),
  from: {
    email: env('MAIL_FROM_ADDRESS', '[email protected]'),
    name: env('MAIL_FROM_NAME', 'Blog'),
  },
  mailers: {
    smtp: {
      driver: 'smtp',
      host: env('MAIL_HOST', '127.0.0.1'),
      port: env('MAIL_PORT', 1025),
      secure: env('MAIL_SECURE', false),
      user: env('MAIL_USERNAME') || undefined,
      password: env('MAIL_PASSWORD') || undefined,
    },
  },
})
OptionDefaultDescription
default'preview'Default mailer name.
fromnoneDefault sender: { email, name? }.
replyTononeDefault reply-to address: { email, name? }.
queue.queuedfalseQueue every mail instead of sending immediately.
queue.connection, queue.queuequeue defaultsWhere queued mail goes.
queue.afterCommitfalseWait for the current database transaction to commit before queueing.
preview.allowedEnvironments['development']Environments where mail previews are available.
markdown.wrappernoneCustom wrapper for Markdown mail.
mailerspreview, log, fake, smtpNamed mailers. Each can override from, replyTo, and queue.

Mailer options by driver:

DriverOptions
previewpath (default .holo-js/runtime/mail-preview). Saves mail for previewing.
loglogBodies (default false). Logs mail instead of sending.
fakenone. Records mail for tests.
smtphost (default 127.0.0.1), port (default 1025), secure, user, password.

notifications.ts ​

See Notifications.

OptionDefaultDescription
table'notifications'Table for database notifications.
queue.connection, queue.queuequeue defaultsWhere queued notifications go.
queue.afterCommitfalseWait for the database transaction to commit before queueing.

session.ts ​

Session storage and cookie. Created by holo install auth. See Sessions.

OptionDefaultDescription
driver'file'Store name to use. Must exist in stores.
storesfile and databaseNamed stores (see below).
cookie.name'holo_session'Cookie name.
cookie.path'/'Cookie path.
cookie.domainnoneCookie domain.
cookie.securefalseSend only over HTTPS. Set true in production.
cookie.httpOnlytrueHide the cookie from JavaScript.
cookie.sameSite'lax''lax', 'strict', or 'none' ('none' requires secure: true).
cookie.partitionedfalsePartitioned cookie (requires secure: true).
cookie.maxAgeabsoluteLifetimeCookie lifetime in minutes.
idleTimeout120Minutes of inactivity before a session expires.
absoluteLifetime120Maximum session age in minutes.
rememberMeLifetime43200"Remember me" lifetime in minutes (30 days).

Store options:

DriverOptions
filepath (default ./storage/framework/sessions).
databaseconnection (default 'default'), table (default 'sessions').
redisconnection (a config/redis.ts name; defaults to the Redis default), prefix.

auth.ts ​

Authentication. Created by holo install auth. See Authentication and Guards and Providers.

OptionDefaultDescription
defaults.guard'web'Default guard.
defaults.passwords'users'Default password reset broker.
guardsweb: session guard using usersNamed guards: { driver: 'session' | 'token', provider }.
providersusers: model User, identifiers ['email']Named user providers: { model, identifiers? }.
passwordsusers brokerPassword reset brokers (see below).
emailVerification{ required: false, route: '/verify-email' }Email verification. Pass true to require it.
multiFactordisabledMulti-factor auth. Pass true or an options object.
personalAccessTokens.defaultAbilities['*']Abilities given to new API tokens.
socialEncryptionKeyapp.keyKey for encrypting stored social login tokens.
social{}Social login providers.
workos{}WorkOS settings.
clerk{}Clerk settings.

Password broker options: provider (default 'users'), table (default 'password_reset_tokens'), expire (minutes, default 60), throttle (minutes between reset emails, default 60), route (default '/reset-password').

Multi-factor options: issuer (default 'Holo'), challengeRoute (default '/mfa-challenge'), enrollmentTtl (seconds, default 600), challengeTtl (seconds, default 300), recoveryCodes (default 8), allowedDriftSteps (default 1).

Social provider options: clientId, clientSecret, redirectUri, scopes, guard, mapToProvider, encryptTokens.

security.ts ​

CSRF protection, rate limiting, and trusted proxies. Created by holo install security or holo install auth. See Security Overview.

ts
import { defineSecurityConfig, limit } from '@holo-js/security'
import { env } from '@holo-js/config'

export default defineSecurityConfig({
  csrf: true,
  rateLimit: {
    driver: env('RATE_LIMIT_DRIVER', 'file'),
    limiters: {
      login: limit.perMinute(5).define(),
    },
  },
})
OptionDefaultDescription
csrfenabledtrue keeps CSRF protection on with defaults, false turns it off, or pass an options object (below).
csrf.enabledtrueCheck unsafe requests for a CSRF token. Set false to turn checks off.
csrf.field'_token'Form field name.
csrf.header'X-CSRF-TOKEN'Header name.
csrf.cookie'XSRF-TOKEN'Cookie name.
csrf.except[]Paths that skip CSRF checks.
rateLimit.driver'memory''memory', 'file', or 'redis'. New projects use 'file'.
rateLimit.file.path./storage/framework/rate-limitsFolder for the file driver.
rateLimit.redis.connection'default'Redis connection name.
rateLimit.redis.prefix'holo:rate-limit:'Key prefix.
rateLimit.limiters{}Named rate limiters.
trustedProxies[]IP addresses or CIDR ranges of proxies whose X-Forwarded-* headers Holo trusts, or '*' to trust the proxy that connects. Projects created with holo new read it from TRUSTED_PROXIES. See Trusted proxies.

cors.ts ​

CORS headers. Created by holo install security or holo install auth. See CORS and Proxies.

OptionDefaultDescription
paths['/api/*']Paths that get CORS headers.
origins[]Allowed origins.
methodsGET, POST, PUT, PATCH, DELETE, OPTIONSAllowed methods.
headersContent-Type, Authorization, X-CSRF-TOKEN, X-XSRF-TOKEN, X-Requested-WithAllowed request headers.
credentialsfalseAllow cookies on cross-origin requests.
maxAge7200Seconds browsers may cache the preflight response.
statefulDomains[]Frontend domains (host:port) that use session cookies.

broadcast.ts ​

Broadcasting connections and the self-hosted worker. Created by holo install broadcast. See Broadcast Drivers and Config.

OptionDefaultDescription
default'null'Default connection name. New projects use 'holo'.
connectionslog and nullNamed connections.
workersee belowSettings for holo broadcast:work.

Connection drivers: holo (the self-hosted worker), pusher, log, and null. holo and pusher take appId, key, secret, options (host, port, scheme, useTLS, cluster), and clientOptions (passed to the browser client, such as authEndpoint).

Worker options:

OptionDefaultDescription
host'0.0.0.0'Address the worker listens on.
port8080Port the worker listens on.
path'/app'WebSocket path.
publicHost, publicPortnoneHost and port clients connect to, when different (for example behind a proxy).
publicScheme'https'Scheme clients use.
healthPath'/health'Health check path.
statsPath'/stats'Stats path.
statsEnabledfalseTurn on the stats endpoint.
allowedOrigins['https://127.0.0.1']Origins allowed to connect. New projects use APP_URL.
maxRequestBytes1048576Maximum HTTP request size.
maxMessageBytes65536Maximum WebSocket message size.
scalingfalse{ driver: 'redis', connection? } to run several workers. See Scaling in Production.

media.ts ​

Created by holo install media. Collections and conversions are set on each model. See Media Library.

OptionDefaultWhat it does
diskenv('MEDIA_DISK', 'public')Disk for collections that don't set disk().

Next steps ​

Released under the MIT License.