Skip to Content
upserve

Configuration options

Look up required fields, defaults and advanced server settings.

Use this reference after the quick start. Configuration uses the same UpserveConfig shape for createUpserve() and the CLI's defineConfig().

UpserveConfig

OptionTypeRequiredDefaultBehavior
appsRecord<string, AppConfig>YesNoneRegisters applications by URL identifier
cacheCacheStoreNomemoryCache(1000)Chooses the metadata store shared by this instance
namespacestringNo"upserve-v1"Separates deployment data in the store
concurrencynumberNo4Limits simultaneous loads per coordination pool; integer 1 through 64
now() => numberNoDate.nowSupplies epoch milliseconds for cache timing in deterministic tests
background(task: Promise<unknown>) => voidNoNone; await refreshLets the host keep a stale-data refresh alive after responding

Use namespace when multiple deployments share a persistent store. Change it when you change a deployment's security boundary. It isn't a secret.

There are separate coordination pools for resolved metadata and provider resources. concurrency doesn't limit active binary downloads or enforce a distributed budget. now controls cache timing; it doesn't replace GitHub's wall clock for rate-limit headers or webhook cooldowns.

Only configure background if your runtime guarantees the task can finish. See runtime guidance.

AppConfig

OptionTypeRequiredDefaultBehavior
providerProviderYesNoneSource of release metadata and assets
adaptersAdapter[]YesNoneProtocol routes mounted for this application
authorize(request: Request) => boolean or Promise<boolean> resultFor private providersNo access checkDenies with 401 when it returns false
channelsRecord<string, (release: Release) => boolean>NoStable and prerelease predicatesReplaces the default channel map
cacheCachePolicyNoSee belowSets this application's metadata lifetimes
delivery"redirect" or "stream"NoRedirect if public and provider supports itChooses public binary delivery; private providers always stream

See applications, channels and authentication for examples.

CachePolicy

OptionTypeRequiredDefaultExample
ttlnumberNo60_000 ms5 * 60 * 1000 for five minutes fresh
negativeTtlnumberNo15_000 ms10 * 1000 for ten seconds with no releases
staleIfErrornumberNo300_000 ms10 * 60 * 1000 for ten extra minutes after expiry

All values must be finite and nonnegative. Zero is allowed. A zero stale window disables serving old metadata after freshness ends. A zero TTL causes every check to need refresh coordination, so don't use it to bypass GitHub limits.

Provider and adapter options

FactoryConfiguration reference
github(options)GitHub options and test injection
tauri(options?)TauriOptions
electron(options?)ElectronOptions
android(options?)AndroidOptions
generic()No options
memoryCache(maxEntries?)Memory cache
sqliteCache(filename)SQLite cache

The CLI environment variables configure the listener and configuration path. They aren't fields in UpserveConfig.

On this page