notify
Posts an OS-level notification (Notification Center on macOS, Action Center on Windows) via tauri-plugin-notification.
Import
import { notify } from "@fluxlay/react";Signature
interface NotifyOptions {
title: string;
body?: string;
}
function notify(options: NotifyOptions): Promise<void>;Parameters
| Field | Type | Description |
|---|---|---|
title | string | Required. Shown as the notification title. Must be non-empty; an empty title returns 400. |
body | string | Optional. Shown as the notification body. |
Usage
import { notify } from "@fluxlay/react";
await notify({
title: "Pomodoro complete",
body: "Time for a 5 minute break."
});Why this exists
Wallpaper webviews cannot use the browser Notification API: Notification.requestPermission() has no UI surface that the wallpaper origin can present, so permission cannot be granted. The host process owns the OS-level permission and posts notifications on the wallpaper's behalf.
Notes
- The first call from a freshly installed Fluxlay app may trigger an OS-level permission prompt for the Fluxlay process itself. If the user denies, subsequent
notifycalls resolve successfully but no notification appears. - macOS additionally requires the Fluxlay app to be signed and notarized for notifications to display in production builds. Development builds may surface notifications inconsistently depending on local code-signing configuration.
- There is no rate limit at the SDK level. Wallpapers should debounce calls themselves to avoid spamming the user (one notification per significant state change is a reasonable rule).
- Click handlers and rich actions are not exposed in this version. Only
titleandbodyare supported.