Browse topics
Notifications API
Send native OS notifications from your custom resource.
Notifications API
The Notifications API sends native operating system notifications from your resource.
Capability required: notifications:send
Frontend (iframe)
import { createResourceClient } from "@rightplace/sdk";
const rp = createResourceClient();
await rp.ready();
// Simple notification
await rp.notifications.send("Sync Complete");
// Notification with body text
await rp.notifications.send("Build Failed", {
body: "Error in main.js line 42: unexpected token",
});
Backend (Node.js)
import { createResourceServer } from "@rightplace/sdk/server";
const server = createResourceServer({
methods: {
processData: async (params, { rp }) => {
// ... long-running work ...
await rp.notifications.send("Processing Complete", {
body: `Processed ${params.count} items`,
});
return { ok: true };
},
},
});
server.start();
API Reference
rp.notifications.send(title, opts?)
| Parameter | Type | Description |
|---|---|---|
title | string | The notification title |
opts.body | string (optional) | The notification body text |
| Returns | Promise<void> |
Manifest Configuration
{
"capabilities": [
"notifications:send"
]
}
Notes
- Notifications use the native OS notification system (macOS Notification Center).
- The user’s system notification settings apply — notifications may be silenced by Focus modes.
- Keep notifications brief and actionable. Avoid spamming notifications from cron tasks or background processes.