@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.
Enumerations
Section titled “Enumerations”Importance
Section titled “Importance”Enumeration Members
Section titled “Enumeration Members”Default
Section titled “Default”Default: 3;High: 4;Low: 2;Min: 1;None: 0;ScheduleEvery
Section titled “ScheduleEvery”Enumeration Members
Section titled “Enumeration Members”Day: "day";Hour: "hour";Minute
Section titled “Minute”Minute: "minute";Month: "month";Second
Section titled “Second”Second: "second";Not supported on iOS.
TwoWeeks
Section titled “TwoWeeks”TwoWeeks: "twoWeeks";Week: "week";Year: "year";Visibility
Section titled “Visibility”Enumeration Members
Section titled “Enumeration Members”Private
Section titled “Private”Private: 0;Public
Section titled “Public”Public: 1;Secret
Section titled “Secret”Secret: -1;Classes
Section titled “Classes”Schedule
Section titled “Schedule”Constructors
Section titled “Constructors”new Schedule()
Section titled “new Schedule()”new Schedule(): ScheduleReturns
Section titled “Returns”Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
at |
undefined | object |
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L175 |
every |
undefined | object |
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L190 |
interval |
undefined | object |
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L183 |
Methods
Section titled “Methods”static at( date, repeating, allowWhileIdle): ScheduleParameters
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, count, allowWhileIdle): ScheduleParameters
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, allowWhileIdle): ScheduleParameters
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”Properties
Section titled “Properties”ActionType
Section titled “ActionType”Properties
Section titled “Properties”ActiveNotification
Section titled “ActiveNotification”Properties
Section titled “Properties”Attachment
Section titled “Attachment”Attachment of a notification.
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
id |
string |
Attachment identifier. | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L235 |
url |
string |
Attachment URL. Accepts the asset and file protocols. |
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L237 |
Channel
Section titled “Channel”Properties
Section titled “Properties”Options
Section titled “Options”Options to send a notification.
2.0.0
Properties
Section titled “Properties”PendingNotification
Section titled “PendingNotification”Properties
Section titled “Properties”ScheduleInterval
Section titled “ScheduleInterval”Properties
Section titled “Properties”Type Aliases
Section titled “Type Aliases”PermissionState
Section titled “PermissionState”type PermissionState: "granted" | "denied" | "prompt" | "prompt-with-rationale";Source: undefined
Functions
Section titled “Functions”active()
Section titled “active()”function active(): Promise<ActiveNotification[]>Retrieves the list of active notifications.
Returns
Section titled “Returns”A promise resolving to the list of active notifications.
Example
Section titled “Example”import { active } from '@tauri-apps/plugin-notification';const activeNotifications = await active();2.0.0
cancel()
Section titled “cancel()”function cancel(notifications): Promise<void>Cancels the pending notifications with the given list of identifiers.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
notifications |
number[] |
Returns
Section titled “Returns”Promise<void>
A promise indicating the success or failure of the operation.
Example
Section titled “Example”import { cancel } from '@tauri-apps/plugin-notification';await cancel([-34234, 23432, 4311]);2.0.0
cancelAll()
Section titled “cancelAll()”function cancelAll(): Promise<void>Cancels all pending notifications.
Returns
Section titled “Returns”Promise<void>
A promise indicating the success or failure of the operation.
Example
Section titled “Example”import { cancelAll } from '@tauri-apps/plugin-notification';await cancelAll();2.0.0
channels()
Section titled “channels()”function channels(): Promise<Channel[]>Retrieves the list of notification channels.
Returns
Section titled “Returns”A promise resolving to the list of notification channels.
Example
Section titled “Example”import { channels } from '@tauri-apps/plugin-notification';const notificationChannels = await channels();2.0.0
createChannel()
Section titled “createChannel()”function createChannel(channel): Promise<void>Creates a notification channel.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
channel |
Channel |
Returns
Section titled “Returns”Promise<void>
A promise indicating the success or failure of the operation.
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});2.0.0
isPermissionGranted()
Section titled “isPermissionGranted()”function isPermissionGranted(): Promise<boolean>Checks if the permission to send notifications is granted.
Returns
Section titled “Returns”Promise<boolean>
Example
Section titled “Example”import { isPermissionGranted } from '@tauri-apps/plugin-notification';const permissionGranted = await isPermissionGranted();2.0.0
onAction()
Section titled “onAction()”function onAction(cb): Promise<PluginListener>Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
cb |
(notification) => void |
Returns
Section titled “Returns”Promise<PluginListener>
onNotificationReceived()
Section titled “onNotificationReceived()”function onNotificationReceived(cb): Promise<PluginListener>Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
cb |
(notification) => void |
Returns
Section titled “Returns”Promise<PluginListener>
pending()
Section titled “pending()”function pending(): Promise<PendingNotification[]>Retrieves the list of pending notifications.
Returns
Section titled “Returns”Promise<PendingNotification[]>
A promise resolving to the list of pending notifications.
Example
Section titled “Example”import { pending } from '@tauri-apps/plugin-notification';const pendingNotifications = await pending();2.0.0
registerActionTypes()
Section titled “registerActionTypes()”function registerActionTypes(types): Promise<void>Register actions that are performed when the user clicks on the notification.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
types |
ActionType[] |
Returns
Section titled “Returns”Promise<void>
A promise indicating the success or failure of the operation.
Example
Section titled “Example”import { registerActionTypes } from '@tauri-apps/plugin-notification';await registerActionTypes([{ id: 'tauri', actions: [{ id: 'my-action', title: 'Settings' }]}])2.0.0
removeActive()
Section titled “removeActive()”function removeActive(notifications): Promise<void>Removes the active notifications with the given list of identifiers.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
notifications |
object[] |
Returns
Section titled “Returns”Promise<void>
A promise indicating the success or failure of the operation.
Example
Section titled “Example”import { cancel } from '@tauri-apps/plugin-notification';await cancel([-34234, 23432, 4311])2.0.0
removeAllActive()
Section titled “removeAllActive()”function removeAllActive(): Promise<void>Removes all active notifications.
Returns
Section titled “Returns”Promise<void>
A promise indicating the success or failure of the operation.
Example
Section titled “Example”import { removeAllActive } from '@tauri-apps/plugin-notification';await removeAllActive()2.0.0
removeChannel()
Section titled “removeChannel()”function removeChannel(id): Promise<void>Removes the channel with the given identifier.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
string |
Returns
Section titled “Returns”Promise<void>
A promise indicating the success or failure of the operation.
Example
Section titled “Example”import { removeChannel } from '@tauri-apps/plugin-notification';await removeChannel();2.0.0
requestPermission()
Section titled “requestPermission()”function requestPermission(): Promise<NotificationPermission>Requests the permission to send notifications.
Returns
Section titled “Returns”Promise<NotificationPermission>
A promise resolving to whether the user granted the permission or not.
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';}2.0.0
sendNotification()
Section titled “sendNotification()”function sendNotification(options): voidSends a notification to the user.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
string | Options |
Returns
Section titled “Returns”void
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!' });}2.0.0
© 2026 Tauri Contributors. CC-BY / MIT