@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.
Functions
Section titled “Functions”active()
Section titled “active()”function active(): Promise<ActiveNotification[]>;Defined in: plugins/notification/guest-js/index.ts:466
Retrieves the list of active notifications.
Example
Section titled “Example”import { active } from '@tauri-apps/plugin-notification';const activeNotifications = await active();Returns
Section titled “Returns”A promise resolving to the list of active notifications.
2.0.0
cancel()
Section titled “cancel()”function cancel(notifications: number[]): Promise<void>;Defined in: plugins/notification/guest-js/index.ts:432
Cancels the pending notifications with the given list of identifiers.
Example
Section titled “Example”import { cancel } from '@tauri-apps/plugin-notification';await cancel([-34234, 23432, 4311]);Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
notifications |
number[] |
Returns
Section titled “Returns”A promise indicating the success or failure of the operation.
2.0.0
cancelAll()
Section titled “cancelAll()”function cancelAll(): Promise<void>;Defined in: plugins/notification/guest-js/index.ts:449
Cancels all pending notifications.
Example
Section titled “Example”import { cancelAll } from '@tauri-apps/plugin-notification';await cancelAll();Returns
Section titled “Returns”A promise indicating the success or failure of the operation.
2.0.0
channels()
Section titled “channels()”function channels(): Promise<Channel[]>;Defined in: plugins/notification/guest-js/index.ts:560
Retrieves the list of notification channels.
Example
Section titled “Example”import { channels } from '@tauri-apps/plugin-notification';const notificationChannels = await channels();Returns
Section titled “Returns”A promise resolving to the list of notification channels.
2.0.0
createChannel()
Section titled “createChannel()”function createChannel(channel: Channel): Promise<void>;Defined in: plugins/notification/guest-js/index.ts:526
Creates a notification channel.
Example
Section titled “Example”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});Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
channel |
Channel |
Returns
Section titled “Returns”A promise indicating the success or failure of the operation.
2.0.0
isPermissionGranted()
Section titled “isPermissionGranted()”function isPermissionGranted(): Promise<boolean>;Defined in: plugins/notification/guest-js/index.ts:326
Checks if the permission to send notifications is granted.
Example
Section titled “Example”import { isPermissionGranted } from '@tauri-apps/plugin-notification';const permissionGranted = await isPermissionGranted();Returns
Section titled “Returns”2.0.0
onAction()
Section titled “onAction()”function onAction(cb: (notification: Options) => void): Promise<PluginListener>;Defined in: plugins/notification/guest-js/index.ts:570
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
cb |
(notification: Options) => void |
Returns
Section titled “Returns”onNotificationReceived()
Section titled “onNotificationReceived()”function onNotificationReceived(cb: (notification: Options) => void): Promise<PluginListener>;Defined in: plugins/notification/guest-js/index.ts:564
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
cb |
(notification: Options) => void |
Returns
Section titled “Returns”pending()
Section titled “pending()”function pending(): Promise<PendingNotification[]>;Defined in: plugins/notification/guest-js/index.ts:415
Retrieves the list of pending notifications.
Example
Section titled “Example”import { pending } from '@tauri-apps/plugin-notification';const pendingNotifications = await pending();Returns
Section titled “Returns”Promise<PendingNotification[]>
A promise resolving to the list of pending notifications.
2.0.0
registerActionTypes()
Section titled “registerActionTypes()”function registerActionTypes(types: ActionType[]): Promise<void>;Defined in: plugins/notification/guest-js/index.ts:398
Register actions that are performed when the user clicks on the notification.
Example
Section titled “Example”import { registerActionTypes } from '@tauri-apps/plugin-notification';await registerActionTypes([{ id: 'tauri', actions: [{ id: 'my-action', title: 'Settings' }]}])Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
types |
ActionType[] |
Returns
Section titled “Returns”A promise indicating the success or failure of the operation.
2.0.0
removeActive()
Section titled “removeActive()”function removeActive(notifications: { id: number; tag?: string;}[]): Promise<void>;Defined in: plugins/notification/guest-js/index.ts:483
Removes the active notifications with the given list of identifiers.
Example
Section titled “Example”import { cancel } from '@tauri-apps/plugin-notification';await cancel([-34234, 23432, 4311])Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
notifications |
{ id: number; tag?: string; }[] |
Returns
Section titled “Returns”A promise indicating the success or failure of the operation.
2.0.0
removeAllActive()
Section titled “removeAllActive()”function removeAllActive(): Promise<void>;Defined in: plugins/notification/guest-js/index.ts:502
Removes all active notifications.
Example
Section titled “Example”import { removeAllActive } from '@tauri-apps/plugin-notification';await removeAllActive()Returns
Section titled “Returns”A promise indicating the success or failure of the operation.
2.0.0
removeChannel()
Section titled “removeChannel()”function removeChannel(id: string): Promise<void>;Defined in: plugins/notification/guest-js/index.ts:543
Removes the channel with the given identifier.
Example
Section titled “Example”import { removeChannel } from '@tauri-apps/plugin-notification';await removeChannel();Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
string |
Returns
Section titled “Returns”A promise indicating the success or failure of the operation.
2.0.0
requestPermission()
Section titled “requestPermission()”function requestPermission(): Promise<NotificationPermission>;Defined in: plugins/notification/guest-js/index.ts:349
Requests the permission to send notifications.
Example
Section titled “Example”import { isPermissionGranted, requestPermission } from '@tauri-apps/plugin-notification';let permissionGranted = await isPermissionGranted();if (!permissionGranted) { const permission = await requestPermission(); permissionGranted = permission === 'granted';}Returns
Section titled “Returns”Promise<NotificationPermission>
A promise resolving to whether the user granted the permission or not.
2.0.0
sendNotification()
Section titled “sendNotification()”function sendNotification(options: string | Options): void;Defined in: plugins/notification/guest-js/index.ts:371
Sends a notification to the user.
Example
Section titled “Example”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!' });}Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
string | Options |
Returns
Section titled “Returns”void
2.0.0
Enumerations
Section titled “Enumerations”Importance
Section titled “Importance”Defined in: plugins/notification/guest-js/index.ts:290
Enumeration Members
Section titled “Enumeration Members”| Enumeration Member | Value | Defined in |
|---|---|---|
Default |
3 |
plugins/notification/guest-js/index.ts:294 |
High |
4 |
plugins/notification/guest-js/index.ts:295 |
Low |
2 |
plugins/notification/guest-js/index.ts:293 |
Min |
1 |
plugins/notification/guest-js/index.ts:292 |
None |
0 |
plugins/notification/guest-js/index.ts:291 |
ScheduleEvery
Section titled “ScheduleEvery”Defined in: plugins/notification/guest-js/index.ts:161
Enumeration Members
Section titled “Enumeration Members”| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
Day |
"day" |
- | plugins/notification/guest-js/index.ts:166 |
Hour |
"hour" |
- | plugins/notification/guest-js/index.ts:167 |
Minute |
"minute" |
- | plugins/notification/guest-js/index.ts:168 |
Month |
"month" |
- | plugins/notification/guest-js/index.ts:163 |
Second |
"second" |
Not supported on iOS. | plugins/notification/guest-js/index.ts:172 |
TwoWeeks |
"twoWeeks" |
- | plugins/notification/guest-js/index.ts:164 |
Week |
"week" |
- | plugins/notification/guest-js/index.ts:165 |
Year |
"year" |
- | plugins/notification/guest-js/index.ts:162 |
Visibility
Section titled “Visibility”Defined in: plugins/notification/guest-js/index.ts:298
Enumeration Members
Section titled “Enumeration Members”| Enumeration Member | Value | Defined in |
|---|---|---|
Private |
0 |
plugins/notification/guest-js/index.ts:300 |
Public |
1 |
plugins/notification/guest-js/index.ts:301 |
Secret |
-1 |
plugins/notification/guest-js/index.ts:299 |
Classes
Section titled “Classes”Schedule
Section titled “Schedule”Defined in: plugins/notification/guest-js/index.ts:175
Constructors
Section titled “Constructors”new Schedule()
Section titled “new Schedule()”new Schedule(): Schedule;Returns
Section titled “Returns”Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
at |
| { allowWhileIdle: boolean; date: Date; repeating: boolean; } | undefined |
plugins/notification/guest-js/index.ts:176 |
every |
| { allowWhileIdle: boolean; count: number; interval: ScheduleEvery; } | undefined |
plugins/notification/guest-js/index.ts:191 |
interval |
| { allowWhileIdle: boolean; interval: ScheduleInterval; } | undefined |
plugins/notification/guest-js/index.ts:184 |
Methods
Section titled “Methods”static at( date: Date, repeating?: boolean, allowWhileIdle?: boolean): Schedule;Defined in: plugins/notification/guest-js/index.ts:199
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
date |
Date |
undefined |
repeating |
boolean |
false |
allowWhileIdle |
boolean |
false |
Returns
Section titled “Returns”every()
Section titled “every()”static every( kind: ScheduleEvery, count: number, allowWhileIdle?: boolean): Schedule;Defined in: plugins/notification/guest-js/index.ts:218
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
kind |
ScheduleEvery |
undefined |
count |
number |
undefined |
allowWhileIdle |
boolean |
false |
Returns
Section titled “Returns”interval()
Section titled “interval()”static interval(interval: ScheduleInterval, allowWhileIdle?: boolean): Schedule;Defined in: plugins/notification/guest-js/index.ts:207
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
interval |
ScheduleInterval |
undefined |
allowWhileIdle |
boolean |
false |
Returns
Section titled “Returns”Interfaces
Section titled “Interfaces”Action
Section titled “Action”Defined in: plugins/notification/guest-js/index.ts:241
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
destructive? |
boolean |
plugins/notification/guest-js/index.ts:246 |
foreground? |
boolean |
plugins/notification/guest-js/index.ts:245 |
id |
string |
plugins/notification/guest-js/index.ts:242 |
input? |
boolean |
plugins/notification/guest-js/index.ts:247 |
inputButtonTitle? |
string |
plugins/notification/guest-js/index.ts:248 |
inputPlaceholder? |
string |
plugins/notification/guest-js/index.ts:249 |
requiresAuthentication? |
boolean |
plugins/notification/guest-js/index.ts:244 |
title |
string |
plugins/notification/guest-js/index.ts:243 |
ActionType
Section titled “ActionType”Defined in: plugins/notification/guest-js/index.ts:252
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
actions |
Action[] |
The list of associated actions | plugins/notification/guest-js/index.ts:260 |
allowInCarPlay? |
boolean |
- | plugins/notification/guest-js/index.ts:263 |
customDismissAction? |
boolean |
- | plugins/notification/guest-js/index.ts:262 |
hiddenPreviewsBodyPlaceholder? |
string |
- | plugins/notification/guest-js/index.ts:261 |
hiddenPreviewsShowSubtitle? |
boolean |
- | plugins/notification/guest-js/index.ts:265 |
hiddenPreviewsShowTitle? |
boolean |
- | plugins/notification/guest-js/index.ts:264 |
id |
string |
The identifier of this action type | plugins/notification/guest-js/index.ts:256 |
ActiveNotification
Section titled “ActiveNotification”Defined in: plugins/notification/guest-js/index.ts:275
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
actionTypeId? |
string |
plugins/notification/guest-js/index.ts:285 |
attachments |
Attachment[] |
plugins/notification/guest-js/index.ts:284 |
body? |
string |
plugins/notification/guest-js/index.ts:279 |
data |
Record<string, string> |
plugins/notification/guest-js/index.ts:282 |
extra |
Record<string, unknown> |
plugins/notification/guest-js/index.ts:283 |
group? |
string |
plugins/notification/guest-js/index.ts:280 |
groupSummary |
boolean |
plugins/notification/guest-js/index.ts:281 |
id |
number |
plugins/notification/guest-js/index.ts:276 |
schedule? |
Schedule |
plugins/notification/guest-js/index.ts:286 |
sound? |
string |
plugins/notification/guest-js/index.ts:287 |
tag? |
string |
plugins/notification/guest-js/index.ts:277 |
title? |
string |
plugins/notification/guest-js/index.ts:278 |
Attachment
Section titled “Attachment”Defined in: plugins/notification/guest-js/index.ts:234
Attachment of a notification.
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
id |
string |
Attachment identifier. | plugins/notification/guest-js/index.ts:236 |
url |
string |
Attachment URL. Accepts the asset and file protocols. |
plugins/notification/guest-js/index.ts:238 |
Channel
Section titled “Channel”Defined in: plugins/notification/guest-js/index.ts:304
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
description? |
string |
plugins/notification/guest-js/index.ts:307 |
id |
string |
plugins/notification/guest-js/index.ts:305 |
importance? |
Importance |
plugins/notification/guest-js/index.ts:312 |
lightColor? |
string |
plugins/notification/guest-js/index.ts:310 |
lights? |
boolean |
plugins/notification/guest-js/index.ts:309 |
name |
string |
plugins/notification/guest-js/index.ts:306 |
sound? |
string |
plugins/notification/guest-js/index.ts:308 |
vibration? |
boolean |
plugins/notification/guest-js/index.ts:311 |
visibility? |
Visibility |
plugins/notification/guest-js/index.ts:313 |
Options
Section titled “Options”Defined in: plugins/notification/guest-js/index.ts:25
Options to send a notification.
2.0.0
Properties
Section titled “Properties”| 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:111 |
autoCancel? |
boolean |
Automatically cancel the notification when the user clicks on it. | plugins/notification/guest-js/index.ts:127 |
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:115 |
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:97 |
iconColor? |
string |
Icon color on Android. | plugins/notification/guest-js/index.ts:107 |
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:91 |
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:103 |
number? |
number |
Sets the number of items this notification represents on Android. | plugins/notification/guest-js/index.ts:139 |
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:123 |
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:131 |
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:83 |
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:135 |
PendingNotification
Section titled “PendingNotification”Defined in: plugins/notification/guest-js/index.ts:268
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
body? |
string |
plugins/notification/guest-js/index.ts:271 |
id |
number |
plugins/notification/guest-js/index.ts:269 |
schedule |
Schedule |
plugins/notification/guest-js/index.ts:272 |
title? |
string |
plugins/notification/guest-js/index.ts:270 |
ScheduleInterval
Section titled “ScheduleInterval”Defined in: plugins/notification/guest-js/index.ts:142
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
day? |
number |
- | plugins/notification/guest-js/index.ts:145 |
hour? |
number |
- | plugins/notification/guest-js/index.ts:156 |
minute? |
number |
- | plugins/notification/guest-js/index.ts:157 |
month? |
number |
- | plugins/notification/guest-js/index.ts:144 |
second? |
number |
- | plugins/notification/guest-js/index.ts:158 |
weekday? |
number |
1 - Sunday 2 - Monday 3 - Tuesday 4 - Wednesday 5 - Thursday 6 - Friday 7 - Saturday | plugins/notification/guest-js/index.ts:155 |
year? |
number |
- | plugins/notification/guest-js/index.ts:143 |
Type Aliases
Section titled “Type Aliases”PermissionState
Section titled “PermissionState”type PermissionState = "granted" | "denied" | "prompt" | "prompt-with-rationale";Defined in: @tauri-apps/api/core.d.ts:87
© 2026 Tauri Contributors. CC-BY / MIT