Adds a notification system to Payload with stored in-site notices and optional email copies. Other code or plugins register notification kinds, and a notify function creates notices without ever throwing. Emails go through your own sender, can be switched off per group by each person, and are retried with backoff by a queue you run from scheduled jobs. Requires Payload 3.80 or newer and an access rule for managers.
Notifications for Payload: in-site notices, email copies people can turn off per kind, and a retrying send queue, with kinds registered by your own code or other plugins.
Installation
npm i @extantape/payload-plugin-notifications0
Stars
0
Forks
0
Open Issues
1 weeks ago
Last Updated
127
Weekly Downloads
v0.1.0
npm Version
53.9 KB
Unpacked Size
0
Dependencies
00 since Nov 8
| Date | Stars |
|---|---|
| Dec 6, 2026 | 0 |
| Dec 5, 2026 | 0 |
| Dec 4, 2026 | 0 |
| Dec 3, 2026 | 0 |
| Dec 2, 2026 | 0 |
| Dec 1, 2026 | 0 |
| Nov 30, 2026 | 0 |
| Nov 29, 2026 | 0 |
| Nov 28, 2026 | 0 |
| Nov 27, 2026 | 0 |
| Nov 26, 2026 | 0 |
| Nov 25, 2026 | 0 |
| Nov 24, 2026 | 0 |
| Nov 23, 2026 | 0 |
| Nov 22, 2026 | 0 |
| Nov 21, 2026 | 0 |
| Nov 20, 2026 | 0 |
| Nov 19, 2026 | 0 |
| Nov 18, 2026 | 0 |
| Nov 17, 2026 | 0 |
| Nov 16, 2026 | 0 |
| Nov 15, 2026 | 0 |
| Nov 14, 2026 | 0 |
| Nov 13, 2026 | 0 |
| Nov 12, 2026 | 0 |
| Nov 11, 2026 | 0 |
| Nov 10, 2026 | 0 |
| Nov 9, 2026 | 0 |
| Nov 8, 2026 | 0 |
139+139 since Nov 14
| Date | Weekly downloads |
|---|---|
| Dec 6, 2026 | 139 |
| Dec 5, 2026 | 182 |
| Dec 4, 2026 | 347 |
| Dec 3, 2026 | 381 |
| Dec 2, 2026 | 407 |
| Dec 1, 2026 | 430 |
| Nov 30, 2026 | 466 |
| Nov 29, 2026 | 542 |
| Nov 28, 2026 | 493 |
| Nov 27, 2026 | 319 |
| Nov 26, 2026 | 260 |
| Nov 25, 2026 | 223 |
| Nov 24, 2026 | 176 |
| Nov 23, 2026 | 138 |
| Nov 22, 2026 | 216 |
| Nov 21, 2026 | 213 |
| Nov 20, 2026 | 211 |
| Nov 19, 2026 | 211 |
| Nov 18, 2026 | 205 |
| Nov 17, 2026 | 193 |
| Nov 16, 2026 | 181 |
| Nov 15, 2026 | 0 |
| Nov 14, 2026 | 0 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1456394259-root)<a href="https://payloaddirectory.dev/plugins/1456394259-root"><img src="https://payloaddirectory.dev/badge/1456394259-root.svg" alt="Payload Directory"></a>README
Notifications for Payload: in-site notices, email copies people can turn off per kind, and a retrying send queue, with kinds registered by your own code or other plugins.
Status: 0.1.0, not on npm yet. 31 tests pass against Payload 3.92 with an in-memory MongoDB replica set. They cover the endpoints through Payload's own routing with real sign-in tokens, kinds from two owners, refusals, dedupe, the caller's transaction, logs without personal data, preferences per site, the age limit on emails, backoff, priority order, overlapping queue runs, access with and without a site field, rules that answer oddly or throw, who each email goes to, and retention. No site uses it yet, and no real email has been sent: the tests capture email.
text), an optional email (email), and defaults: priority, a group for the preferences page, on or off by default, or required. Your site passes its kinds as an option. Another plugin adds its own to config.custom.notificationKinds without importing this one, and plugin order doesn't matter. A kind registered twice stops the site at start-up, naming both owners.notify(payload, { recipient, kind, params, link, actor, dedupeKey, scope }, req) stores a notice and sends its email copy.
dedupeKey for the same person within 24 hours is stored once.req with one), a rolled-back action leaves no notice, and the email waits for the queue instead of going out before the commit. A refused or failed notice never rolls back your transaction, because notify checks everything first and writes through the database adapter, not a Payload operation. A database error inside your transaction (a write conflict, say) can still abort it, as any write in it would.sendEmail), so your branding and your send switch apply. Each email ends with a link to the person's preferences.
isActive); or when the kind is never emailed.sendPendingNotifications(payload), every few minutes from your scheduled job. It sends high priority first, then normal, then low, oldest first. Each email is claimed with a conditional write before it's sent, so runs that overlap don't send one twice. That's tested on MongoDB; other databases aren't tested. A claim left by a run that died is picked up after 15 minutes, so a send that hangs longer than that can go twice.emailMaxAgeHours (48) when its email's turn comes is skipped. Switching email on, or restoring a copy of the database, can't send old notices.notification-preferences, so nothing is added to your users.A person reads only their own notices, on the current site (scopeFor) when the plugin is scoped; with no site, nothing. Managers read everyone's: access.manage is required, and only an answer of exactly true counts.
The delivery fields (email status, skip reason, attempts, times, dedupe key) are for managers only.
Nobody creates, changes or deletes notices through the API.
Endpoints for the signed-in person, all Cache-Control: no-store:
| Method and path | Body | Answer |
|---|---|---|
GET /api/notifications/mine?limit&before | { docs: [{ id, kind, text, link, createdAt, read }] }, newest first, at most 100 | |
GET /api/notifications/unread | { count } | |
POST /api/notifications/read | { ids } or { all: true } | { marked }, the person's own only |
GET /api/notification-preferences/mine | { allEmail, rows: [{ key, label, email, required }] } | |
POST /api/notification-preferences/mine | { key, email }, where key is all or a row's key | the preferences |
They're collection endpoints, so with other slugs the paths follow. Signed out is 401, and a request with no site is 403.
The same functions are exported for your own pages: listNotifications, unreadCount, markRead, getPreferences, setPreference.
pruneNotifications(payload), daily, deletes read notices older than 180 days (retentionDays) and unread ones older than twice that.sendEmail and no email adapter, Payload's own console adapter prints each email's address and subject: set one before real people sign up.Params are what a notice shows, so keep them to names and words. Never put ages, birth dates, locations or contact details in them.
On its own: Notifications needs only Payload, an access.manage rule, your kinds, and a way to send email (sendEmail, or Payload's email adapter). Run its queue and its clean-up from your scheduled jobs.
Needs: Payload ^3.80.0 as a peer dependency. No other EXTANT APE plugin is required.
Works with: any plugin that registers kinds at config.custom.notificationKinds and sends through config.custom.notifications.notify, as shown under Install. Neither side imports the other. Those wired so far:
notify option at this plugin's notify.noticeFor gives the tracking status, and the plugin that owns the parcel sends it through here.ai-budget:credits-out and sends the credits-out notice through here.notify function Playlists asks for and has it call this plugin's, choosing who hears about waiting reviews and stopped syncs. The two functions take different arguments, so you can't pass one in as the other.Color Theory: none needed. It has no screens of its own, and its collections use Payload's standard admin, which takes Color Theory's admin colors when its applyToAdmin option is on.
Family: Notifications has no family on purpose: it's meant to work with any plugin. The families are a working draft, and Fulfillment, where several of its partners sit, is due to be split.
npm install @extantape/payload-plugin-notifications
import { notificationsPlugin, notify } from '@extantape/payload-plugin-notifications'
export default buildConfig({
plugins: [
notificationsPlugin({
kinds: {
'transfer-offered': {
text: (p) => `${p.from} offered you ${p.animal}`,
email: (p, { link }) => ({ subject: `${p.from} wants to transfer ${p.animal} to you`, text: `Accept or decline it: ${link}` }),
group: 'Transfers',
},
},
access: { manage: ({ req }) => req.user?.role === 'admin' }, // required
sendEmail: ({ to, subject, text }) => mySiteEmail({ to, subject, text }),
isActive: (user) => user.status === 'active',
// With a tenant plugin: scopeField: 'tenant', scopeFor: (req) => tenantOf(req), and add both collections to it.
}),
],
})
await notify(payload, { recipient: animal.offeredTo, actor: req.user?.id, kind: 'transfer-offered', params: { from: 'Made Up', animal: animal.name }, link: '/my-animals' }, req)
From another plugin, without a dependency:
// In your plugin's config function:
config.custom = { ...config.custom, notificationKinds: [...(config.custom?.notificationKinds ?? []), { owner: 'my-plugin', kinds: { 'kit-ready': { text: (p) => `Kit ${p.code} is ready` } } }] }
// When something happens:
const notify = payload.config.custom?.notifications?.notify
if (notify) await notify(payload, { recipient, kind: 'kit-ready', params: { code } }, req)
else /* your own fallback, or nothing */
Build the collections' indexes before first use. Run sendPendingNotifications every few minutes and pruneNotifications daily.
npm test # integration tests, in-memory MongoDB
npm run typecheck
npm run build
MIT. See LICENSE.
payload notifications
Notifications collection with channels, per-user subscriptions, read state and optional web push delivery
67141/wk1v3
payload plugin notifications
In-dashboard notifications for the Payload admin with a live bell that updates over server-sent events
469/wk7v3
payload plugin notifications
Recipient-scoped notification inbox collection with optional SSE live updates for Payload 3
6015/wk3v3
payload plugin sms
Send SMS from Payload through Twilio, Telnyx, Plivo, Vonage or AWS SNS using a single sendSMS call
5380/wk7v3
email queue
Queue Payload form builder emails as background jobs so submissions return immediately and failed sends are retried
78466/wk0v4
telegram
Send Telegram messages when Payload form builder forms are submitted, with optional UTM data
76499/wk0v4