Skip to content

Configuration

All Hypersonic configuration lives in a single hypersonic.config.ts file at your project root.

hypersonic.config.ts

ts
import { defineConfig } from '@hypersonic-js/complete'

export default defineConfig({
  server: {
    port: 3000,
    host: 'localhost',
  },
  database: {
    provider: 'sqlite',
  },
  auth: {
    trustedOrigins: ['http://localhost:3000'],
  },
  inertia: {
    ssr: false,
  },
})

defineConfig is a typed identity function — it gives you full autocomplete and catches typos at compile time.

server

OptionTypeDescription
portnumberPort the HTTP server listens on
hoststringHostname to bind to

database

OptionTypeDescription
provider'sqlite' | 'postgresql'Database driver

The scaffolded project uses sqlite with no extra setup. Switch to postgresql for production and update DATABASE_URL in your .env.

auth

OptionTypeDescription
trustedOriginsstring[]Origins allowed to make cross-origin auth requests
providers{ github?: boolean, google?: boolean }OAuth providers to enable
rateLimit.enabledbooleanSet to false to disable Better Auth's built-in rate limiting (useful in test environments)

OAuth providers

Enable a provider in config and supply its credentials in .env:

ts
auth: {
  trustedOrigins: ['https://myapp.com'],
  providers: {
    github: true,
    google: true,
  },
},
bash
# .env
GITHUB_CLIENT_ID=...
GITHUB_CLIENT_SECRET=...
GOOGLE_CLIENT_ID=...
GOOGLE_CLIENT_SECRET=...

The framework validates that the required env vars are present on startup and throws a descriptive error if any are missing.

inertia

OptionTypeDescription
ssrbooleanEnable server-side rendering
versionstringAsset version string sent to clients for cache-busting

logging

OptionTypeDescription
level'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal' | 'silent'Minimum log level emitted by the Pino logger. Defaults to 'error' when omitted
ts
logging: {
  level: 'debug',
},

Environment variables

Hypersonic reads two required env vars at startup:

VariableDescription
DATABASE_URLPrisma connection string
BETTER_AUTH_SECRETSecret used to sign session tokens — minimum 32 characters

These must be present in .env (or exported in your shell) before starting the server. The framework throws a descriptive error if either is missing.

Released under the MIT License.