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.

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L77

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

new Update(metadata): Update;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L121

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

Parameter Type Description
metadata UpdateMetadata The update information returned by the backend, including the resource identifier of the update.

Update

import { check } from '@tauri-apps/plugin-updater';
// the update instance is created for you by `check`
const update = await check();
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 Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L84
body? string The release notes of the update, when the server provided them. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L100
currentVersion string The version of the application that is currently running. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L88
date? string The publish date of the update as an RFC 3339 string, when the server provided one. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L96
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. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L105
version string The version announced by the update server. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L92

get rid(): number;

Source: undefined

number

Resource.rid

close(): Promise<void>;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L259

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

Promise<void>

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

download(onEvent?, options?): Promise<void>;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L154

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

Parameter Type Description
onEvent? (progress) => 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>

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();
}

downloadAndInstall(onEvent?, options?): Promise<void>;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L230

Downloads the updater package and installs it

  • 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
Parameter Type Description
onEvent? (progress) => 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>

import { check } from '@tauri-apps/plugin-updater';
const update = await check();
if (update) {
await update.downloadAndInstall((event) => {
console.log(event.event);
});
}

install(options?): Promise<void>;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L192

Install downloaded updater package. Must be called after download.

  • 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
Parameter Type Description
options? InstallOptions Options for the installation, such as whether the Windows installer should restart the app afterwards.

Promise<void>

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

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L15

Options used when checking for updates

Property Type Description Defined in
headers? HeadersInit The headers to send along with the update check request. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L19
proxy? string A proxy url to be used when checking and downloading updates. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L27
target? string Target identifier for the running application. This is sent to the backend. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L31
timeout? number Timeout in milliseconds Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L23

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L35

Options used when downloading an update

Property Type Description Defined in
headers? HeadersInit The headers to send along with the update download request. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L39
timeout? number Timeout in milliseconds Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L43

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

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L64

Updater download event

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

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L285

Checks the configured endpoints for an available update.

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.

import { check } from '@tauri-apps/plugin-updater';
const update = await check();
if (update) {
console.log(`update ${update.version} is available`);
await update.downloadAndInstall();
}

2.0.0


© 2026 Tauri Contributors. CC-BY / MIT