🚧 VeloxKit is pre-release software. APIs may change before v1.0. Get started →
Documentation
APIs & Bindings
notification

notification Stable WINMACLNX

Send native desktop notifications. The notification appears in the OS notification center and is fire-and-forget — there is no click callback in the current release.

Capability

veloxkit.config.json
{
  "capabilities": ["notification"]
}

Import

import { notification } from 'veloxkit'

notification.send({ title, body? })

Send a desktop notification.

await notification.send({
  title: 'Export complete',
  body:  'Your PDF has been saved to ~/Downloads/report.pdf',
})

Parameters

ParamTypeDefaultDescription
titlestringNotification headline (required)
bodystring''Supporting text shown below the title

Returns Promise<void>. Resolves when the notification has been handed to the OS — does not wait for the user to dismiss it.


Examples

Long-running task completion

import { notification } from 'veloxkit'
 
async function processLargeFile(path: string) {
  // ... time-consuming work ...
  const result = await doWork(path)
 
  await notification.send({
    title: 'Processing complete',
    body:  `${result.rowCount.toLocaleString()} rows imported successfully.`,
  })
 
  return result
}

Background sync

async function syncNotes() {
  try {
    const { added, updated } = await syncToServer()
 
    if (added + updated > 0) {
      await notification.send({
        title: 'Notes synced',
        body:  `${added} added, ${updated} updated.`,
      })
    }
  } catch (err) {
    await notification.send({
      title: 'Sync failed',
      body:  err.message,
    })
  }
}

Reminder system

function scheduleReminder(message: string, delayMs: number) {
  setTimeout(async () => {
    await notification.send({
      title: 'Reminder',
      body:  message,
    })
  }, delayMs)
}
 
// Remind in 30 minutes
scheduleReminder('Time to take a break!', 30 * 60 * 1000)

On macOS, notifications require the app to be code-signed for them to appear in Notification Center reliably. During development (unsigned), they may show only in the notification list.

⚠️

Click-to-open callbacks and notification actions are not yet implemented. The notification is purely informational. Track progress at the GitHub issues (opens in a new tab).