Skip to content

@tauri-apps/plugin-notification

Send toast notifications (brief auto-expiring OS window element) to your user. Can also be used with the Notification Web API.

Defined in: plugins/notification/guest-js/index.ts:289

Default: 3;

Defined in: plugins/notification/guest-js/index.ts:293

High: 4;

Defined in: plugins/notification/guest-js/index.ts:294

Low: 2;

Defined in: plugins/notification/guest-js/index.ts:292

Min: 1;

Defined in: plugins/notification/guest-js/index.ts:291

None: 0;

Defined in: plugins/notification/guest-js/index.ts:290


Defined in: plugins/notification/guest-js/index.ts:160

Day: "day";

Defined in: plugins/notification/guest-js/index.ts:165

Hour: "hour";

Defined in: plugins/notification/guest-js/index.ts:166

Minute: "minute";

Defined in: plugins/notification/guest-js/index.ts:167

Month: "month";

Defined in: plugins/notification/guest-js/index.ts:162

Second: "second";

Defined in: plugins/notification/guest-js/index.ts:171

Not supported on iOS.

TwoWeeks: "twoWeeks";

Defined in: plugins/notification/guest-js/index.ts:163

Week: "week";

Defined in: plugins/notification/guest-js/index.ts:164

Year: "year";

Defined in: plugins/notification/guest-js/index.ts:161


Defined in: plugins/notification/guest-js/index.ts:297

Private: 0;

Defined in: plugins/notification/guest-js/index.ts:299

Public: 1;

Defined in: plugins/notification/guest-js/index.ts:300

Secret: -1;

Defined in: plugins/notification/guest-js/index.ts:298

Defined in: plugins/notification/guest-js/index.ts:174

new Schedule(): Schedule;

Schedule

Property Type Defined in
at | { allowWhileIdle: boolean; date: Date; repeating: boolean; } | undefined plugins/notification/guest-js/index.ts:175
every | { allowWhileIdle: boolean; count: number; interval: ScheduleEvery; } | undefined plugins/notification/guest-js/index.ts:190
interval | { allowWhileIdle: boolean; interval: ScheduleInterval; } | undefined plugins/notification/guest-js/index.ts:183

static at(
date,
repeating?,
allowWhileIdle?): Schedule;

Defined in: plugins/notification/guest-js/index.ts:198

Parameter Type Default value
date Date undefined
repeating boolean false
allowWhileIdle boolean false

Schedule

static every(
kind,
count,
allowWhileIdle?): Schedule;

Defined in: plugins/notification/guest-js/index.ts:217

Parameter Type Default value
kind ScheduleEvery undefined
count number undefined
allowWhileIdle boolean false

Schedule

static interval(interval, allowWhileIdle?): Schedule;

Defined in: plugins/notification/guest-js/index.ts:206

Parameter Type Default value
interval ScheduleInterval undefined
allowWhileIdle boolean false

Schedule

Defined in: plugins/notification/guest-js/index.ts:240

Property Type Defined in
destructive? boolean plugins/notification/guest-js/index.ts:245
foreground? boolean plugins/notification/guest-js/index.ts:244
id string plugins/notification/guest-js/index.ts:241
input? boolean plugins/notification/guest-js/index.ts:246
inputButtonTitle? string plugins/notification/guest-js/index.ts:247
inputPlaceholder? string plugins/notification/guest-js/index.ts:248
requiresAuthentication? boolean plugins/notification/guest-js/index.ts:243
title string plugins/notification/guest-js/index.ts:242

Defined in: plugins/notification/guest-js/index.ts:251

Property Type Description Defined in
actions Action[] The list of associated actions plugins/notification/guest-js/index.ts:259
allowInCarPlay? boolean - plugins/notification/guest-js/index.ts:262
customDismissAction? boolean - plugins/notification/guest-js/index.ts:261
hiddenPreviewsBodyPlaceholder? string - plugins/notification/guest-js/index.ts:260
hiddenPreviewsShowSubtitle? boolean - plugins/notification/guest-js/index.ts:264
hiddenPreviewsShowTitle? boolean - plugins/notification/guest-js/index.ts:263
id string The identifier of this action type plugins/notification/guest-js/index.ts:255

Defined in: plugins/notification/guest-js/index.ts:274

Property Type Defined in
actionTypeId? string plugins/notification/guest-js/index.ts:284
attachments Attachment[] plugins/notification/guest-js/index.ts:283
body? string plugins/notification/guest-js/index.ts:278
data Record<string, string> plugins/notification/guest-js/index.ts:281
extra Record<string, unknown> plugins/notification/guest-js/index.ts:282
group? string plugins/notification/guest-js/index.ts:279
groupSummary boolean plugins/notification/guest-js/index.ts:280
id number plugins/notification/guest-js/index.ts:275
schedule? Schedule plugins/notification/guest-js/index.ts:285
sound? string plugins/notification/guest-js/index.ts:286
tag? string plugins/notification/guest-js/index.ts:276
title? string plugins/notification/guest-js/index.ts:277

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

Attachment of a notification.

Property Type Description Defined in
id string Attachment identifier. plugins/notification/guest-js/index.ts:235
url string Attachment URL. Accepts the asset and file protocols. plugins/notification/guest-js/index.ts:237

Defined in: plugins/notification/guest-js/index.ts:303

Property Type Defined in
description? string plugins/notification/guest-js/index.ts:306
id string plugins/notification/guest-js/index.ts:304
importance? Importance plugins/notification/guest-js/index.ts:311
lightColor? string plugins/notification/guest-js/index.ts:309
lights? boolean plugins/notification/guest-js/index.ts:308
name string plugins/notification/guest-js/index.ts:305
sound? string plugins/notification/guest-js/index.ts:307
vibration? boolean plugins/notification/guest-js/index.ts:310
visibility? Visibility plugins/notification/guest-js/index.ts:312

Defined in: plugins/notification/guest-js/index.ts:25

Options to send a notification.

2.0.0

Property Type Description Defined in
actionTypeId? string Defines an action type for this notification. plugins/notification/guest-js/index.ts:62
attachments? Attachment[] Notification attachments. plugins/notification/guest-js/index.ts:110
autoCancel? boolean Automatically cancel the notification when the user clicks on it. plugins/notification/guest-js/index.ts:126
body? string Optional notification body. plugins/notification/guest-js/index.ts:44
channelId? string Identifier of the Channel that deliveres this notification. If the channel does not exist, the notification won’t fire. Make sure the channel exists with listChannels and createChannel. plugins/notification/guest-js/index.ts:36
extra? Record<string, unknown> Extra payload to store in the notification. plugins/notification/guest-js/index.ts:114
group? string Identifier used to group multiple notifications. https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent/1649872-threadidentifier plugins/notification/guest-js/index.ts:68
groupSummary? boolean Instructs the system that this notification is the summary of a group on Android. plugins/notification/guest-js/index.ts:72
icon? string Notification icon. On Android the icon must be placed in the app’s res/drawable folder. plugins/notification/guest-js/index.ts:96
iconColor? string Icon color on Android. plugins/notification/guest-js/index.ts:106
id? number The notification identifier to reference this object later. Must be a 32-bit integer. plugins/notification/guest-js/index.ts:29
inboxLines? string[] List of lines to add to the notification. Changes the notification style to inbox. Cannot be used with largeBody. Only supports up to 5 lines. plugins/notification/guest-js/index.ts:90
largeBody? string Multiline text. Changes the notification style to big text. Cannot be used with inboxLines. plugins/notification/guest-js/index.ts:54
largeIcon? string Notification large icon (Android). The icon must be placed in the app’s res/drawable folder. plugins/notification/guest-js/index.ts:102
number? number Sets the number of items this notification represents on Android. plugins/notification/guest-js/index.ts:138
ongoing? boolean If true, the notification cannot be dismissed by the user on Android. An application service must manage the dismissal of the notification. It is typically used to indicate a background task that is pending (e.g. a file download) or the user is engaged with (e.g. playing music). plugins/notification/guest-js/index.ts:122
schedule? Schedule Schedule this notification to fire on a later time or a fixed interval. plugins/notification/guest-js/index.ts:48
silent? boolean Changes the notification presentation to be silent on iOS (no badge, no sound, not listed). plugins/notification/guest-js/index.ts:130
sound? string The sound resource name or file path for the notification. Platform specific behavior: - On macOS: use system sounds (e.g., “Ping”, “Blow”) or sound files in the app bundle - On Linux: use XDG theme sounds (e.g., “message-new-instant”) or file paths - On Windows: use file paths to sound files (.wav format) - On Mobile: use resource names plugins/notification/guest-js/index.ts:82
summary? string Detail text for the notification with largeBody, inboxLines or groupSummary. plugins/notification/guest-js/index.ts:58
title string Notification title. plugins/notification/guest-js/index.ts:40
visibility? Visibility Notification visibility. plugins/notification/guest-js/index.ts:134

Defined in: plugins/notification/guest-js/index.ts:267

Property Type Defined in
body? string plugins/notification/guest-js/index.ts:270
id number plugins/notification/guest-js/index.ts:268
schedule Schedule plugins/notification/guest-js/index.ts:271
title? string plugins/notification/guest-js/index.ts:269

Defined in: plugins/notification/guest-js/index.ts:141

Property Type Description Defined in
day? number - plugins/notification/guest-js/index.ts:144
hour? number - plugins/notification/guest-js/index.ts:155
minute? number - plugins/notification/guest-js/index.ts:156
month? number - plugins/notification/guest-js/index.ts:143
second? number - plugins/notification/guest-js/index.ts:157
weekday? number 1 - Sunday 2 - Monday 3 - Tuesday 4 - Wednesday 5 - Thursday 6 - Friday 7 - Saturday plugins/notification/guest-js/index.ts:154
year? number - plugins/notification/guest-js/index.ts:142

type PermissionState = "granted" | "denied" | "prompt" | "prompt-with-rationale";

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

function active(): Promise<ActiveNotification[]>;

Defined in: plugins/notification/guest-js/index.ts:465

Retrieves the list of active notifications.

Promise<ActiveNotification[]>

A promise resolving to the list of active notifications.

import { active } from '@tauri-apps/plugin-notification';
const activeNotifications = await active();

2.0.0


function cancel(notifications): Promise<void>;

Defined in: plugins/notification/guest-js/index.ts:431

Cancels the pending notifications with the given list of identifiers.

Parameter Type
notifications number[]

Promise<void>

A promise indicating the success or failure of the operation.

import { cancel } from '@tauri-apps/plugin-notification';
await cancel([-34234, 23432, 4311]);

2.0.0


function cancelAll(): Promise<void>;

Defined in: plugins/notification/guest-js/index.ts:448

Cancels all pending notifications.

Promise<void>

A promise indicating the success or failure of the operation.

import { cancelAll } from '@tauri-apps/plugin-notification';
await cancelAll();

2.0.0


function channels(): Promise<Channel[]>;

Defined in: plugins/notification/guest-js/index.ts:559

Retrieves the list of notification channels.

Promise<Channel[]>

A promise resolving to the list of notification channels.

import { channels } from '@tauri-apps/plugin-notification';
const notificationChannels = await channels();

2.0.0


function createChannel(channel): Promise<void>;

Defined in: plugins/notification/guest-js/index.ts:525

Creates a notification channel.

Parameter Type
channel Channel

Promise<void>

A promise indicating the success or failure of the operation.

import { createChannel, Importance, Visibility } from '@tauri-apps/plugin-notification';
await createChannel({
id: 'new-messages',
name: 'New Messages',
lights: true,
vibration: true,
importance: Importance.Default,
visibility: Visibility.Private
});

2.0.0


function isPermissionGranted(): Promise<boolean>;

Defined in: plugins/notification/guest-js/index.ts:325

Checks if the permission to send notifications is granted.

Promise<boolean>

import { isPermissionGranted } from '@tauri-apps/plugin-notification';
const permissionGranted = await isPermissionGranted();

2.0.0


function onAction(cb): Promise<PluginListener>;

Defined in: plugins/notification/guest-js/index.ts:569

Parameter Type
cb (notification) => void

Promise<PluginListener>


function onNotificationReceived(cb): Promise<PluginListener>;

Defined in: plugins/notification/guest-js/index.ts:563

Parameter Type
cb (notification) => void

Promise<PluginListener>


function pending(): Promise<PendingNotification[]>;

Defined in: plugins/notification/guest-js/index.ts:414

Retrieves the list of pending notifications.

Promise<PendingNotification[]>

A promise resolving to the list of pending notifications.

import { pending } from '@tauri-apps/plugin-notification';
const pendingNotifications = await pending();

2.0.0


function registerActionTypes(types): Promise<void>;

Defined in: plugins/notification/guest-js/index.ts:397

Register actions that are performed when the user clicks on the notification.

Parameter Type
types ActionType[]

Promise<void>

A promise indicating the success or failure of the operation.

import { registerActionTypes } from '@tauri-apps/plugin-notification';
await registerActionTypes([{
id: 'tauri',
actions: [{
id: 'my-action',
title: 'Settings'
}]
}])

2.0.0


function removeActive(notifications): Promise<void>;

Defined in: plugins/notification/guest-js/index.ts:482

Removes the active notifications with the given list of identifiers.

Parameter Type
notifications object[]

Promise<void>

A promise indicating the success or failure of the operation.

import { cancel } from '@tauri-apps/plugin-notification';
await cancel([-34234, 23432, 4311])

2.0.0


function removeAllActive(): Promise<void>;

Defined in: plugins/notification/guest-js/index.ts:501

Removes all active notifications.

Promise<void>

A promise indicating the success or failure of the operation.

import { removeAllActive } from '@tauri-apps/plugin-notification';
await removeAllActive()

2.0.0


function removeChannel(id): Promise<void>;

Defined in: plugins/notification/guest-js/index.ts:542

Removes the channel with the given identifier.

Parameter Type
id string

Promise<void>

A promise indicating the success or failure of the operation.

import { removeChannel } from '@tauri-apps/plugin-notification';
await removeChannel();

2.0.0


function requestPermission(): Promise<NotificationPermission>;

Defined in: plugins/notification/guest-js/index.ts:348

Requests the permission to send notifications.

Promise<NotificationPermission>

A promise resolving to whether the user granted the permission or not.

import { isPermissionGranted, requestPermission } from '@tauri-apps/plugin-notification';
let permissionGranted = await isPermissionGranted();
if (!permissionGranted) {
const permission = await requestPermission();
permissionGranted = permission === 'granted';
}

2.0.0


function sendNotification(options): void;

Defined in: plugins/notification/guest-js/index.ts:370

Sends a notification to the user.

Parameter Type
options string | Options

void

import { isPermissionGranted, requestPermission, sendNotification } from '@tauri-apps/plugin-notification';
let permissionGranted = await isPermissionGranted();
if (!permissionGranted) {
const permission = await requestPermission();
permissionGranted = permission === 'granted';
}
if (permissionGranted) {
sendNotification('Tauri is awesome!');
sendNotification({ title: 'TAURI', body: 'Tauri is awesome!' });
}

2.0.0


© 2026 Tauri Contributors. CC-BY / MIT