Configuration, environment, and session context.
System settings are stored encrypted in the database and accessed through a caching layer. Environment variables provide runtime configuration for the edge deployment.
Create a type guard from a readonly array of string literal values
Get booking fee percentage from database. Returns 0 if not set.
Get the Bunny CDN API key from environment
Get the Bunny DNS subdomain suffix (e.g. ".tickets") from environment
Get the Bunny DNS zone ID from environment
Get the Bunny Edge Script ID from environment
Return the cached session if already resolved, or undefined if not yet resolved
Get the effective domain synchronously (must call loadEffectiveDomain first).
Get allowed embed hosts from database (encrypted, parsed to array) Returns empty array if not configured (embedding allowed from anywhere)
Get an environment variable value Checks process.env first (Bunny Edge), falls back to Deno.env (local dev)
Check if Bunny CDN pull zone management is enabled Requires both BUNNY_API_KEY and BUNNY_SCRIPT_ID to be set
Check if Bunny DNS subdomain feature is enabled. Requires BUNNY_API_KEY and BUNNY_DNS_ZONE_ID to be set.
Whether an event can accept payments (has a price or allows pay-what-you-want)
Check if payments are enabled (any provider configured with valid keys)
Check if the system is in read-only mode (READ_ONLY env var)
Load the effective domain from DB, falling back to the request URL hostname.
Parse a flash cookie value into type, message, and optional result
Get a required environment variable, throwing if not set.
Use this instead of getEnv(key) as string when the variable must exist.
Reset effective domain cache (for testing).
Run a function within a session-memoization scope
Store the resolved session in the current request scope
Set effective domain directly (for testing).
- active: boolean
- assign_built_site: boolean
- attachment_name: string
- attachment_url: string
- bookable_days: string[]
- can_pay_more: boolean
- closes_at: string | null
- created: string
- date: string
- description: string
- event_type: EventType
- fields: EventFields
- group_id: number
- hidden: boolean
- id: number
- image_url: string
- location: string
- max_attendees: number
- max_price: number
- max_quantity: number
- maximum_days_after: number
- minimum_days_before: number
- name: string
- non_transferable: boolean
- purchase_only: boolean
- slug: string
- slug_index: string
- thank_you_url: string
- unit_price: number
- webhook_url: string
Admin API event shape — all event fields except internal indices. Used by both admin JSON API and admin templates to ensure consistent field exposure. Snake_case keys match the DB schema.
Admin role levels
Session data needed by admin page templates
A single row in the attendee table (attendee + parent event context)
Individual contact field name
& Partial<
Required name+email with optional phone/address/special_instructions from ContactInfo
Attendee contact details — the core PII fields collected at registration
Contact fields setting for an event (comma-separated ContactField names, or empty for name-only). Alias kept for documentation; runtime enforcement happens in parseEventFields.
Event type: standard (one-time) or daily (date-based booking)
Supported payment provider identifiers
Short keys used in the PII blob JSON to minimize encrypted payload size
UI theme
All valid contact field names (runtime array matching the ContactField union)
Type guard: check if a string is a valid AdminLevel
Type guard: check if an arbitrary string is a valid ContactField
Type guard: check if an arbitrary string is a valid EventType
Type guard: check if a string is a valid PaymentProviderType
Usage
import * as mod from "docs/config.ts";