Sitelet https://github.com/Cap-go/tauri-updater
Skip to content

Latest commit

Β 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Tauri Updater

Capgo - Instant updates for capacitor

Discord Discord npm GitHub latest commit https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg

OTA (Over-The-Air) updates for Tauri applications. 100% feature parity with @capgo/capacitor-updater.

Open-source alternative to Tauri's built-in updater with live update capabilities.

Features

  • πŸš€ Live Updates - Push updates instantly without app store review
  • πŸ”„ Auto-Update - Automatic update checking and installation
  • πŸ›‘οΈ Rollback Protection - Automatic rollback if update fails
  • πŸ“¦ Bundle Management - Full control over downloaded bundles
  • πŸ” End-to-End Encryption - Secure update delivery
  • πŸ“Š Channel System - Deploy to different user groups
  • ⏱️ Delay Conditions - Control when updates are applied

Installation

npm install @capgo/tauri-updater

Tauri Plugin Requirements

Install and register these Tauri plugins in your app:

  • @tauri-apps/plugin-fs
  • @tauri-apps/plugin-http
  • @tauri-apps/plugin-process

Quick Start

import { TauriUpdater } from '@capgo/tauri-updater';

const updater = new TauriUpdater({
  appId: 'com.example.app',
  autoUpdate: true,
});

await updater.initialize();

// IMPORTANT: Call this on every app launch!
await updater.notifyAppReady();

// Check for updates manually
const latest = await updater.getLatest();
if (latest.url && !latest.error) {
  const bundle = await updater.download({
    url: latest.url,
    version: latest.version,
    checksum: latest.checksum,
  });

  // Queue for next restart
  await updater.next({ id: bundle.id });
}

updater.addListener('download', (event) => {
  console.log(`Download progress: ${event.percent}%`);
});

API Reference

Core Methods

Method Description
notifyAppReady() Must be called on every launch - Confirms bundle loaded successfully
download(options) Download a bundle from URL
next(options) Queue bundle for next restart
set(options) Immediately switch to bundle and reload
reload() Reload the app with current bundle
delete(options) Delete a bundle from storage
reset(options) Reset to builtin or last successful bundle

Bundle Information

Method Description
current() Get current bundle and native version
list(options) List all downloaded bundles
getNextBundle() Get bundle queued for next restart
getFailedUpdate() Get info about last failed update
getBuiltinVersion() Get version shipped with app

Update Checking

Method Description
getLatest(options) Check server for latest version

Channel Management

Method Description
setChannel(options) Assign device to a channel
unsetChannel(options) Remove channel assignment
getChannel() Get current channel
listChannels() List available channels

Delay Conditions

Method Description
setMultiDelay(options) Set conditions before update applies
cancelDelay() Clear all delay conditions

Delay condition types:

  • background - Wait for app to be backgrounded (with optional duration)
  • kill - Wait for app to be killed and restarted
  • date - Wait until specific date/time
  • nativeVersion - Wait for native app update

Device Identification

Method Description
getDeviceId() Get unique device ID
setCustomId(options) Set custom identifier

Configuration

Method Description
setUpdateurl(/sitelet?url=https%3A%2F%2Fgithub.com%2FCap-go%2Foptions) Change update server URL
setStatsurl(/sitelet?url=https%3A%2F%2Fgithub.com%2FCap-go%2Foptions) Change statistics URL
setChannelurl(/sitelet?url=https%3A%2F%2Fgithub.com%2FCap-go%2Foptions) Change channel URL
setAppId(options) Change App ID
getAppId() Get current App ID

Debug

Method Description
setDebugMenu(options) Enable/disable debug menu
isDebugMenuEnabled() Check debug menu state

Events

Event Description
download Download progress updates
updateAvailable New update available
noNeedUpdate Already up-to-date
downloadComplete Download finished
downloadFailed Download failed
breakingAvailable Incompatible update available
updateFailed Update installation failed
appReloaded App was reloaded
appReady notifyAppReady() was called

Configuration Options

const updater = new TauriUpdater({
  appId: 'com.example.app',
  version: '1.0.0',
  autoUpdate: true,
  appReadyTimeout: 10000,

  updateUrl: 'https://plugin.capgo.app/updates',
  channelUrl: 'https://plugin.capgo.app/channel_self',
  statsUrl: 'https://plugin.capgo.app/stats',

  publicKey: '...',
  defaultChannel: 'production',

  autoDeleteFailed: true,
  autoDeletePrevious: true,
  resetWhenUpdate: true,

  directUpdate: false,

  allowModifyUrl: false,
  allowModifyAppId: false,
  persistCustomId: false,
  persistModifyUrl: false,

  debugMenu: false,
  disableJSLogging: false,

  periodCheckDelay: 0,
});

Rollback Protection

  1. When a new bundle loads, a timer starts (default: 10 seconds)
  2. Your app must call notifyAppReady() before the timer expires
  3. If the timer expires, the update is considered failed
  4. The app reloads the last-known good bundle

Documentation

Full documentation is available at capgo.app/docs.

Community

Join the discord to get help.

License

Mozilla Public License Version 2.0. See LICENSE for details.

About

OTA updates for Tauri applications

Resources

Code of conduct

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages