Skip to content

@tauri-apps/plugin-updater

In-app updates for Tauri applications: check the configured endpoints for a new release, download it and install it.

function check(options?: CheckOptions): Promise<Update | null>;

Defined in: plugins/updater/guest-js/index.ts:288

Checks the configured endpoints for an available update.

import { check } from '@tauri-apps/plugin-updater';
const update = await check();
if (update) {
console.log(`update ${update.version} is available`);
await update.downloadAndInstall();
}
Parameter Type Description
options? CheckOptions The headers, timeout, proxy and target to use for the update check request.

Promise<Update | null>

A promise resolving to the available Update, or null when no update is available.

2.0.0

Defined in: plugins/updater/guest-js/index.ts:77

An update announced by the update server, as returned by check.

It holds a resource on the Rust side, so call Update.close when you are done with it without installing it.

2.0.0

  • Resource
[key: number]: () => Promise<void>

new Update(metadata: UpdateMetadata): Update;

Defined in: plugins/updater/guest-js/index.ts:121

Creates an update from the metadata returned by the backend. You should not need to call this yourself, use check instead.

import { check } from '@tauri-apps/plugin-updater';
// the update instance is created for you by `check`
const update = await check();
Parameter Type Description
metadata UpdateMetadata The update information returned by the backend, including the resource identifier of the update.

Update

Resource.constructor
Property Type Description Defined in
available boolean Whether an update is available. Deprecated This is always true, check if the return value is null instead when using check plugins/updater/guest-js/index.ts:84
body? string The release notes of the update, when the server provided them. plugins/updater/guest-js/index.ts:100
currentVersion string The version of the application that is currently running. plugins/updater/guest-js/index.ts:88
date? string The publish date of the update as an RFC 3339 string, when the server provided one. plugins/updater/guest-js/index.ts:96
rawJson Record<string, unknown> The raw update manifest returned by the server, useful when it contains additional fields that the updater itself does not handle. plugins/updater/guest-js/index.ts:105
version string The version announced by the update server. plugins/updater/guest-js/index.ts:92

get rid(): number;

Defined in: @tauri-apps/api/core.d.ts:412

number

Resource.rid

close(): Promise<void>;

Defined in: plugins/updater/guest-js/index.ts:262

Releases the update resource and the downloaded bytes held by the backend.

import { check } from '@tauri-apps/plugin-updater';
const update = await check();
if (update) {
await update.close();
}

Promise<void>

Resource.close

download(onEvent?: (progress: DownloadEvent) => void, options?: DownloadOptions): Promise<void>;

Defined in: plugins/updater/guest-js/index.ts:154

Downloads the updater package. Call install later to install it.

import { check } from '@tauri-apps/plugin-updater';
const update = await check();
if (update) {
let downloaded = 0;
await update.download((event) => {
if (event.event === 'Progress') {
downloaded += event.data.chunkLength;
console.log(`downloaded ${downloaded} bytes`);
}
});
await update.install();
}
Parameter Type Description
onEvent? (progress: DownloadEvent) => void Callback invoked with a Started event when the first chunk is received, a Progress event for every downloaded chunk and a Finished event when the download completes.
options? DownloadOptions The headers and the timeout to use for the download request.

Promise<void>

downloadAndInstall(onEvent?: (progress: DownloadEvent) => void, options?: DownloadOptions & InstallOptions): Promise<void>;

Defined in: plugins/updater/guest-js/index.ts:233

Downloads the updater package and installs it

Platform-specific

  • Windows: This function exits the app after launching the updater installer successfully
  • macOS / Linux: You need to relaunch the app to run the newly install version
import { check } from '@tauri-apps/plugin-updater';
const update = await check();
if (update) {
await update.downloadAndInstall((event) => {
console.log(event.event);
});
}
Parameter Type Description
onEvent? (progress: DownloadEvent) => void Callback invoked with a Started event when the first chunk is received, a Progress event for every downloaded chunk and a Finished event when the download completes.
options? DownloadOptions & InstallOptions The headers and the timeout to use for the download request, and the installation options.

Promise<void>

install(options?: InstallOptions): Promise<void>;

Defined in: plugins/updater/guest-js/index.ts:195

Install downloaded updater package. Must be called after download.

Platform-specific

  • Windows: This function exits the app after launching the updater installer successfully
  • macOS / Linux: You need to relaunch the app to run the newly install version
import { check } from '@tauri-apps/plugin-updater';
const update = await check();
if (update) {
await update.download();
await update.install();
}
Parameter Type Description
options? InstallOptions Options for the installation, such as whether the Windows installer should restart the app afterwards.

Promise<void>

Defined in: plugins/updater/guest-js/index.ts:15

Options used when checking for updates

Property Type Description Defined in
headers? HeadersInit The headers to send along with the update check request. plugins/updater/guest-js/index.ts:19
proxy? string A proxy url to be used when checking and downloading updates. plugins/updater/guest-js/index.ts:27
target? string Target identifier for the running application. This is sent to the backend. plugins/updater/guest-js/index.ts:31
timeout? number Timeout in milliseconds plugins/updater/guest-js/index.ts:23

Defined in: plugins/updater/guest-js/index.ts:35

Options used when downloading an update

Property Type Description Defined in
headers? HeadersInit The headers to send along with the update download request. plugins/updater/guest-js/index.ts:39
timeout? number Timeout in milliseconds plugins/updater/guest-js/index.ts:43

type DownloadEvent =
| {
data: {
contentLength?: number;
};
event: "Started";
}
| {
data: {
chunkLength: number;
};
event: "Progress";
}
| {
event: "Finished";
};

Defined in: plugins/updater/guest-js/index.ts:64

Updater download event


© 2026 Tauri Contributors. CC-BY / MIT