Skip to Content
upserve

GitHub Releases

Connect a public or private repository and understand tag matching and upstream requests.

Use the GitHub provider to read published releases and their assets. Start with a public repository and add authentication only if you need it.

Install @neplex/upserve-github alongside @neplex/upserve and your adapter packages. The quick start includes a complete running server.

provider.ts
import { github } from "@neplex/upserve-github";

export const provider = github({
  repository: "owner/editor",
  tagPrefix: "v",
});

repository is an owner/repository pair, not a URL. Replace owner/editor. With the default prefix v, a tag v1.2.0 produces version 1.2.0. Use tagPrefix: "editor-v" for editor-v1.2.0, or an empty string for bare versions.

Prepare your releases

Publish a release with a valid semantic version tag. Upload your adapter's original manifest and every artifact it references to that release. GitHub's source archives aren't a replacement for your application's updater artifacts.

Upserve scans the release list instead of relying on GitHub's latest-release endpoint. It can therefore select stable and prerelease channels independently and order by semantic version. Drafts aren't offered. See channels for prerelease selection.

Authenticate with GitHub

Pass a token from your environment as token. For private repositories, use a read-only credential with access to repository contents. See GitHub's release API permissions for the token type you're using.

A token enables private mode by default, which requires downstream authorization. Read private releases before adding one. Set private: false only when you're deliberately authenticating API requests for a public repository.

The official provider uses api.github.com and GitHub's release asset hosts. It doesn't accept a custom API origin or support GitHub Enterprise. Implement a custom provider for another host.

Requests and rate limits

Upserve reuses cached GitHub pages rather than requesting them for every client check. When a page needs refreshing, its saved ETag and Last-Modified values become conditional request headers. A 304 Not Modified reuses the previous page body.

The provider fetches 100 releases per page, up to 20 pages by default. If all configured pages are full, it reports a pagination-limit error instead of silently omitting history. Increase maxPages if needed; the maximum is 100. This bounds release lookup and old blockmap searches.

Network and server errors get two retries by default, using exponential backoff with jitter. Rate-limit responses establish a cooldown instead of repeated retries. GitHub's Retry-After and reset time influence when requests resume. A secondary-limit message without those headers pauses requests for one minute. Other 403 responses are treated as access failures. See caching and rate limits for what your clients receive.

Asset URLs

Each asset's public browser_download_url is its canonical URL and the only redirect destination. When GitHub also returns the REST url (https://api.github.com/repos/owner/editor/releases/assets/ID), the provider records it as an asset alias after checking that it names the same asset ID in the configured repository. A mismatched REST URL rejects the release page as invalid. Adapters use aliases only to recognize manifest entries, such as Tauri latest.json files that reference REST URLs.

Options you may need

OptionTypeRequiredDefaultChange it when
repositorystringYesNoneSelecting the GitHub repository
tagPrefixstringNo"v"Your tags use a different prefix
tokenstringNoNoneReading a private repository or authenticating public API requests
privatebooleanNoBoolean(token)Explicitly distinguishing public authenticated access from private releases
webhookSecretstringNoNoneEnabling release webhooks
timeoutnumberNo30_000 msDownloads need more than 30 seconds
maxPagesnumberNo20Release history exceeds the page limit
retriesnumberNo2Tuning network/5xx retries, from 0 to 5
cacheScopestringNoRandom for tokens; anonymous otherwiseReusing persistent data across restarts with a stable credential generation

For test injection options fetch, sleep and random, see the API reference.

On this page