Applications
Register applications, choose update adapters and set per-application behavior.
Use createUpserve() to configure an embedded server. Use defineConfig() in upserve.config.ts for the standalone CLI. The configuration shape is the same, and defineConfig() gives you autocomplete and type checking.
import { defineConfig } from "@neplex/upserve";
import { github } from "@neplex/upserve-github";
import { tauri } from "@neplex/upserve-tauri";
import { android } from "@neplex/upserve-android";
export default defineConfig({
apps: {
editor: {
provider: github({ repository: "owner/editor" }),
adapters: [tauri(), android()],
},
},
});This application exposes Tauri and Android endpoints below /editor/stable and /editor/prerelease. Register another entry in apps to serve a second application with its own provider and policies.
For this configuration, install @neplex/upserve, @neplex/upserve-github, @neplex/upserve-tauri and @neplex/upserve-android, plus @neplex/upserve-cli if you're using the CLI. The quick start shows how to serve an embedded configuration.
Common application options
| Option | Type | Required | Default | Use it to |
|---|---|---|---|---|
provider | Provider | Yes | None | Choose where releases come from |
adapters | Adapter[] | Yes | None | Expose the update protocols you need |
channels | Record<string, (release: Release) => boolean> | No | stable and prerelease | Select releases for each channel |
authorize | (request: Request) => boolean | Promise<boolean> | For private providers | No access check | Decide who can read metadata and download assets |
cache | CachePolicy | No | See caching | Change metadata lifetimes for this application |
delivery | "redirect" | "stream" | No | Redirect when supported | Send public downloads through your server |
App and channel names become URL segments. Start them with a letter or number, then use letters, numbers, ., _ or -, up to 128 characters. Adapter names must be unique within an application.
Keep the first configuration small
For a public repository, start with provider and adapters. You don't need custom cache keys, a persistent store or authorization to try Upserve.
Add authentication for private releases, custom channels when you publish beta builds, or SQLite when you want cached metadata to survive a restart.
Advanced server options
The top-level cache chooses a store for the server; apps.editor.cache controls lifetimes. These are different options. namespace, concurrency, background and now are also top-level options. See the configuration reference for their defaults and examples.
Configuration files and plugins execute as trusted code. Only load configuration you control.