Skip to content

@tauri-apps/api/app

function defaultWindowIcon(): Promise<Image | null>;

Defined in: packages/api/src/app.ts:197

Gets the default window icon.

import { defaultWindowIcon } from '@tauri-apps/api/app';
const icon = await defaultWindowIcon();

Promise<Image | null>

2.0.0


function fetchDataStoreIdentifiers(): Promise<DataStoreIdentifier[]>;

Defined in: packages/api/src/app.ts:160

Fetches the data store identifiers on macOS and iOS.

See https://developer.apple.com/documentation/webkit/wkwebsitedatastore for more information.

import { fetchDataStoreIdentifiers } from '@tauri-apps/api/app';
const ids = await fetchDataStoreIdentifiers();

Promise<DataStoreIdentifier[]>

2.4.0


function getBundleType(): Promise<BundleType>;

Defined in: packages/api/src/app.ts:251

Gets the application bundle type.

import { getBundleType } from '@tauri-apps/api/app';
const type = await getBundleType();

Promise<BundleType>

2.5.0


function getIdentifier(): Promise<string>;

Defined in: packages/api/src/app.ts:112

Gets the application identifier.

import { getIdentifier } from '@tauri-apps/api/app';
const identifier = await getIdentifier();

Promise<string>

The application identifier as configured in tauri.conf.json.

2.4.0


function getName(): Promise<string>;

Defined in: packages/api/src/app.ts:81

Gets the application name.

import { getName } from '@tauri-apps/api/app';
const appName = await getName();

Promise<string>

1.0.0


function getTauriVersion(): Promise<string>;

Defined in: packages/api/src/app.ts:96

Gets the Tauri framework version used by this application.

import { getTauriVersion } from '@tauri-apps/api/app';
const tauriVersion = await getTauriVersion();

Promise<string>

1.0.0


function getVersion(): Promise<string>;

Defined in: packages/api/src/app.ts:67

Gets the application version.

import { getVersion } from '@tauri-apps/api/app';
const appVersion = await getVersion();

Promise<string>

1.0.0


function hide(): Promise<void>;

Defined in: packages/api/src/app.ts:143

Hides the application on macOS.

import { hide } from '@tauri-apps/api/app';
await hide();

Promise<void>

1.2.0


function onBackButtonPress(handler: (payload: OnBackButtonPressPayload) => void): Promise<PluginListener>;

Defined in: packages/api/src/app.ts:267

Listens to the backButton event on Android.

Parameter Type Description
handler (payload: OnBackButtonPressPayload) => void -

Promise<PluginListener>


function removeDataStore(uuid: DataStoreIdentifier): Promise<void>;

Defined in: packages/api/src/app.ts:181

Removes the data store with the given identifier.

Note that any webview using this data store should be closed before running this API.

See https://developer.apple.com/documentation/webkit/wkwebsitedatastore for more information.

import { fetchDataStoreIdentifiers, removeDataStore } from '@tauri-apps/api/app';
for (const id of (await fetchDataStoreIdentifiers())) {
await removeDataStore(id);
}
Parameter Type
uuid DataStoreIdentifier

Promise<void>

2.4.0


function setDockVisibility(visible: boolean): Promise<void>;

Defined in: packages/api/src/app.ts:236

Sets the dock visibility for the application on macOS.

import { setDockVisibility } from '@tauri-apps/api/app';
await setDockVisibility(false);
Parameter Type Description
visible boolean Whether the dock should be visible or not.

Promise<void>

2.5.0


function setTheme(theme?: Theme | null): Promise<void>;

Defined in: packages/api/src/app.ts:219

Sets the application’s theme. Pass in null or undefined to follow the system theme.

import { setTheme } from '@tauri-apps/api/app';
await setTheme('dark');

Platform-specific

  • iOS / Android: Unsupported.
Parameter Type
theme? Theme | null

Promise<void>

2.0.0


function show(): Promise<void>;

Defined in: packages/api/src/app.ts:128

Shows the application on macOS. This function does not automatically focus any specific app window.

import { show } from '@tauri-apps/api/app';
await show();

Promise<void>

1.2.0


function supportsMultipleWindows(): Promise<boolean>;

Defined in: packages/api/src/app.ts:277

Promise<boolean>

Defined in: packages/api/src/app.ts:36

Bundle type of the current application.

Enumeration Member Value Description Defined in
App "app" macOS app bundle packages/api/src/app.ts:48
AppImage "appimage" Linux AppImage packages/api/src/app.ts:46
Deb "deb" Linux Debian package packages/api/src/app.ts:42
Msi "msi" Windows MSI packages/api/src/app.ts:40
Nsis "nsis" Windows NSIS packages/api/src/app.ts:38
Rpm "rpm" Linux RPM packages/api/src/app.ts:44

type DataStoreIdentifier = [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number];

Defined in: packages/api/src/app.ts:14

Identifier type used for data stores on macOS and iOS.

Represents a 128-bit identifier, commonly expressed as a 16-byte UUID.


type OnBackButtonPressPayload = {
canGoBack: boolean;
};

Defined in: packages/api/src/app.ts:258

Payload for the onBackButtonPress event.

Property Type Description Defined in
canGoBack boolean Whether the webview canGoBack property is true. packages/api/src/app.ts:260

© 2026 Tauri Contributors. CC-BY / MIT