Skip to content

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.

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}`,
});
FieldRequiredPurpose
recipientIdyesUser id to notify
titleyesHeadline shown in the list
bodynoSupporting line
linknoWhere clicking it goes

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",
})),
);

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);
}
}
FieldMeaning
indexPosition in the input list
successWhether it was created
notification_idId, when successful
errors{ message, code? } entries when not