Notifications
import { notify } from "platform:notifications";In-app notifications appear under the bell in the app bar. If the recipient has email delivery enabled, they are also emailed.
notify.send
Section titled “notify.send”Variadic — pass as many notifications as you like in one call.
await notify.send({ recipientId: user.user_id, title: "Issue assigned to you", body: "PLAT-431 — Disk nearly full", link: `/record/${issue.record_id}`,});NotificationInput
Section titled “NotificationInput”| Field | Required | Purpose |
|---|---|---|
recipientId | yes | User id to notify |
title | yes | Headline shown in the list |
body | no | Supporting line |
link | no | Where clicking it goes |
Sending in bulk
Section titled “Sending in bulk”Spread an array rather than looping — one call, one round trip.
await notify.send( ...assignees.map((user) => ({ recipientId: user.user_id, title: "New issue in your component", })),);Results
Section titled “Results”Returns NotifyResult[], one per input, in order.
const results = await notify.send(...inputs);
for (const result of results) { if (!result.success) { console.error(`notification ${result.index} failed`, result.errors); }}| Field | Meaning |
|---|---|
index | Position in the input list |
success | Whether it was created |
notification_id | Id, when successful |
errors | { message, code? } entries when not |