updater Stable
Delivers over-the-air updates via GitHub Releases. No server required.
Requires capability: "updater"
Import
import { updater } from 'veloxkit'updater.check(owner, repo, currentVersion)
Check GitHub Releases for a newer version.
const result = await updater.check('acme-inc', 'my-app', '1.0.0')Parameters:
| Param | Type | Description |
|---|---|---|
owner | string | GitHub organization or username |
repo | string | Repository name |
currentVersion | string | Current semver version, e.g. '1.0.0' |
Returns: Promise<UpdateCheckResult>
interface UpdateCheckResult {
hasUpdate: boolean // true if latestVersion > currentVersion
latestVersion: string // e.g. '1.2.0'
body: string // Release notes from GitHub
}Returns immediately — no download. Compares version strings using semver ordering.
updater.update(owner, repo, binName, currentVersion)
Download and install the latest release.
const result = await updater.update('acme-inc', 'my-app', 'my-app', '1.0.0')
if (result.updated) {
// Prompt user to relaunch
console.log(`Updated to ${result.latestVersion}`)
}Parameters:
| Param | Type | Description |
|---|---|---|
owner | string | GitHub organization or username |
repo | string | Repository name |
binName | string | Asset filename prefix (see below) |
currentVersion | string | Current semver version |
Returns: Promise<UpdateResult>
interface UpdateResult {
updated: boolean // false if already on latest version
latestVersion: string // version that was installed (or already running)
}Asset naming
The updater selects the release asset matching the current platform:
| Platform | Asset name |
|---|---|
| Windows | {binName}-windows.exe |
| macOS | {binName}-macos |
| Linux | {binName}-linux |
veloxkit package produces files with exactly these suffixes.
The binary is replaced on disk. The update takes effect on next launch — the running process is not affected. Prompt the user to restart.
Full example
import { updater } from 'veloxkit'
const OWNER = 'acme-inc'
const REPO = 'my-app'
const BIN = 'my-app'
const VERSION = '1.0.0'
// Check silently on launch
setTimeout(async () => {
try {
const check = await updater.check(OWNER, REPO, VERSION)
if (check.hasUpdate) {
console.log(`Update available: ${check.latestVersion}`)
// Show UI notification to user...
}
} catch {
// Network unavailable — ignore
}
}, 5000)
// Install when user confirms
async function installUpdate() {
const result = await updater.update(OWNER, REPO, BIN, VERSION)
if (result.updated) {
// Show "Restart to apply" dialog
}
}GitHub Release setup
- Build release artifacts with
veloxkit package --target windows/macos/linux - Create a GitHub Release with a semver tag (e.g.
v1.2.0) - Attach the platform artifacts — they must match the
{binName}-{platform}pattern
The updater compares the release tag (stripping a leading v) against currentVersion.