Skip to content
Tauri

@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.

Default: 3;

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

High: 4;

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

Low: 2;

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

Min: 1;

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

None: 0;

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


Day: "day";

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

Hour: "hour";

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

Minute: "minute";

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

Month: "month";

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

Second: "second";

Not supported on iOS.

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

TwoWeeks: "twoWeeks";

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

Week: "week";

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

Year: "year";

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


Private: 0;

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

Public: 1;

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

Secret: -1;

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

new Schedule(): Schedule

Schedule

PropertyTypeDefined in
atundefined | objectSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L169
everyundefined | objectSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L184
intervalundefined | objectSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L177

static at(
date,
repeating,
allowWhileIdle): Schedule
ParameterTypeDefault value
dateDateundefined
repeatingbooleanfalse
allowWhileIdlebooleanfalse

Schedule

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

static every(
kind,
count,
allowWhileIdle): Schedule
ParameterTypeDefault value
kindScheduleEveryundefined
countnumberundefined
allowWhileIdlebooleanfalse

Schedule

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

static interval(interval, allowWhileIdle): Schedule
ParameterTypeDefault value
intervalScheduleIntervalundefined
allowWhileIdlebooleanfalse

Schedule

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

PropertyTypeDefined in
destructive?booleanSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L239
foreground?booleanSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L238
idstringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L235
input?booleanSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L240
inputButtonTitle?stringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L241
inputPlaceholder?stringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L242
requiresAuthentication?booleanSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L237
titlestringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L236

PropertyTypeDescriptionDefined in
actionsAction[]The list of associated actionsSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L253
allowInCarPlay?boolean-Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L256
customDismissAction?boolean-Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L255
hiddenPreviewsBodyPlaceholder?string-Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L254
hiddenPreviewsShowSubtitle?boolean-Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L258
hiddenPreviewsShowTitle?boolean-Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L257
idstringThe identifier of this action typeSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L249

PropertyTypeDefined in
actionTypeId?stringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L278
attachmentsAttachment[]Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L277
body?stringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L272
dataRecord<string, string>Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L275
extraRecord<string, unknown>Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L276
group?stringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L273
groupSummarybooleanSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L274
idnumberSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L269
schedule?ScheduleSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L279
sound?stringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L280
tag?stringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L270
title?stringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L271

Attachment of a notification.

PropertyTypeDescriptionDefined in
idstringAttachment identifier.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L229
urlstringAttachment URL. Accepts the asset and file protocols.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L231

PropertyTypeDefined in
description?stringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L300
idstringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L298
importance?ImportanceSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L305
lightColor?stringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L303
lights?booleanSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L302
namestringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L299
sound?stringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L301
vibration?booleanSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L304
visibility?VisibilitySource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L306

Options to send a notification.

2.0.0

PropertyTypeDescriptionDefined in
actionTypeId?stringDefines an action type for this notification.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L62
attachments?Attachment[]Notification attachments.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L104
autoCancel?booleanAutomatically cancel the notification when the user clicks on it.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L120
body?stringOptional notification body.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L44
channelId?stringIdentifier 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.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L36
extra?Record<string, unknown>Extra payload to store in the notification.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L108
group?stringIdentifier used to group multiple notifications. https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent/1649872-threadidentifierSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L68
groupSummary?booleanInstructs the system that this notification is the summary of a group on Android.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L72
icon?stringNotification icon. On Android the icon must be placed in the app’s res/drawable folder.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L90
iconColor?stringIcon color on Android.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L100
id?numberThe notification identifier to reference this object later. Must be a 32-bit integer.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L29
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.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L84
largeBody?stringMultiline text. Changes the notification style to big text. Cannot be used with inboxLines.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L54
largeIcon?stringNotification large icon (Android). The icon must be placed in the app’s res/drawable folder.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L96
number?numberSets the number of items this notification represents on Android.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L132
ongoing?booleanIf 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).Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L116
schedule?ScheduleSchedule this notification to fire on a later time or a fixed interval.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L48
silent?booleanChanges the notification presentation to be silent on iOS (no badge, no sound, not listed).Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L124
sound?stringThe sound resource name. Only available on mobile.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L76
summary?stringDetail text for the notification with largeBody, inboxLines or groupSummary.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L58
titlestringNotification title.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L40
visibility?VisibilityNotification visibility.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L128

PropertyTypeDefined in
body?stringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L264
idnumberSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L262
scheduleScheduleSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L265
title?stringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L263

PropertyTypeDescriptionDefined in
day?number-Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L138
hour?number-Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L149
minute?number-Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L150
month?number-Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L137
second?number-Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L151
weekday?number1 - Sunday 2 - Monday 3 - Tuesday 4 - Wednesday 5 - Thursday 6 - Friday 7 - SaturdaySource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L148
year?number-Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L136

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

Source: undefined

function active(): Promise<ActiveNotification[]>

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

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


function cancel(notifications): Promise<void>

Cancels the pending notifications with the given list of identifiers.

ParameterType
notificationsnumber[]

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

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


function cancelAll(): Promise<void>

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

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


function channels(): Promise<Channel[]>

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

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


function createChannel(channel): Promise<void>

Creates a notification channel.

ParameterType
channelChannel

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

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


function isPermissionGranted(): Promise<boolean>

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

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


function onAction(cb): Promise<PluginListener>
ParameterType
cb(notification) => void

Promise<PluginListener>

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


function onNotificationReceived(cb): Promise<PluginListener>
ParameterType
cb(notification) => void

Promise<PluginListener>

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


function pending(): Promise<PendingNotification[]>

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

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


function registerActionTypes(types): Promise<void>

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

ParameterType
typesActionType[]

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

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


function removeActive(notifications): Promise<void>

Removes the active notifications with the given list of identifiers.

ParameterType
notificationsobject[]

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

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


function removeAllActive(): Promise<void>

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

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


function removeChannel(id): Promise<void>

Removes the channel with the given identifier.

ParameterType
idstring

Promise<void>

A promise indicating the success or failure of the operation.

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

2.0.0

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


function requestPermission(): Promise<NotificationPermission>

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

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


function sendNotification(options): void

Sends a notification to the user.

ParameterType
optionsstring | 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

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


© 2025 Tauri Contributors. CC-BY / MIT