Skip to Content
upserve

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.

upserve.config.ts
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

OptionTypeRequiredDefaultUse it to
providerProviderYesNoneChoose where releases come from
adaptersAdapter[]YesNoneExpose the update protocols you need
channelsRecord<string, (release: Release) => boolean>Nostable and prereleaseSelect releases for each channel
authorize(request: Request) => boolean | Promise<boolean>For private providersNo access checkDecide who can read metadata and download assets
cacheCachePolicyNoSee cachingChange metadata lifetimes for this application
delivery"redirect" | "stream"NoRedirect when supportedSend 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.

On this page