Records who did what and when across collections and globals, including creates, updates, trashes, restores, deletes, logins and logouts. Entries link to the version a change produced instead of storing full document snapshots. Registered as a plugin, it adds an append-only Activity Log collection to the admin panel and requires Payload 3.27 or newer.
Payload plugin that records a chronological activity feed — document creates, updates, deletes, and user logins/logouts — with links to the affected document and version instead of full data snapshots.
Installation
npm i @whatworks/payload-activity-log16
Stars
1
Forks
2
Open Issues
3 days ago
Last Updated
185
Weekly Downloads
v0.3.0
npm Version
160.0 KB
Unpacked Size
0
Dependencies
16+1 since Sep 7
| Date | Stars |
|---|---|
| Dec 6, 2026 | 16 |
| Dec 5, 2026 | 16 |
| Dec 4, 2026 | 16 |
| Dec 3, 2026 | 16 |
| Dec 2, 2026 | 16 |
| Dec 1, 2026 | 16 |
| Nov 30, 2026 | 16 |
| Nov 29, 2026 | 16 |
| Nov 28, 2026 | 16 |
| Nov 27, 2026 | 16 |
| Nov 26, 2026 | 16 |
| Nov 25, 2026 | 16 |
| Nov 24, 2026 | 16 |
| Nov 23, 2026 | 16 |
| Nov 22, 2026 | 16 |
| Nov 21, 2026 | 16 |
| Nov 20, 2026 | 16 |
| Nov 19, 2026 | 16 |
| Nov 18, 2026 | 16 |
| Nov 17, 2026 | 15 |
| Nov 16, 2026 | 15 |
| Nov 15, 2026 | 15 |
| Nov 14, 2026 | 15 |
| Nov 13, 2026 | 15 |
| Nov 12, 2026 | 15 |
| Nov 11, 2026 | 15 |
| Nov 10, 2026 | 15 |
| Nov 9, 2026 | 15 |
| Nov 8, 2026 | 15 |
| Nov 7, 2026 | 15 |
| Nov 6, 2026 | 15 |
| Nov 5, 2026 | 15 |
| Nov 4, 2026 | 15 |
| Nov 3, 2026 | 15 |
| Nov 2, 2026 | 15 |
| Nov 1, 2026 | 15 |
| Oct 31, 2026 | 15 |
| Oct 30, 2026 | 15 |
| Oct 29, 2026 | 15 |
| Oct 28, 2026 | 15 |
| Oct 27, 2026 | 15 |
| Oct 26, 2026 | 15 |
| Oct 25, 2026 | 15 |
| Oct 24, 2026 | 15 |
| Oct 23, 2026 | 15 |
| Oct 22, 2026 | 15 |
| Oct 21, 2026 | 15 |
| Oct 20, 2026 | 15 |
| Oct 19, 2026 | 15 |
| Oct 18, 2026 | 15 |
| Oct 17, 2026 | 15 |
| Oct 16, 2026 | 15 |
| Oct 15, 2026 | 15 |
| Oct 14, 2026 | 15 |
| Oct 13, 2026 | 15 |
| Oct 12, 2026 | 15 |
| Oct 11, 2026 | 15 |
| Oct 10, 2026 | 15 |
| Oct 9, 2026 | 15 |
| Oct 8, 2026 | 15 |
| Oct 7, 2026 | 15 |
| Oct 6, 2026 | 15 |
| Oct 5, 2026 | 15 |
| Oct 4, 2026 | 15 |
| Oct 3, 2026 | 15 |
| Oct 2, 2026 | 15 |
| Oct 1, 2026 | 15 |
| Sep 30, 2026 | 15 |
| Sep 29, 2026 | 15 |
| Sep 28, 2026 | 15 |
| Sep 27, 2026 | 15 |
| Sep 26, 2026 | 15 |
| Sep 25, 2026 | 15 |
| Sep 24, 2026 | 15 |
| Sep 23, 2026 | 15 |
| Sep 22, 2026 | 15 |
| Sep 21, 2026 | 15 |
| Sep 20, 2026 | 15 |
| Sep 19, 2026 | 15 |
| Sep 18, 2026 | 15 |
| Sep 17, 2026 | 15 |
| Sep 16, 2026 | 15 |
| Sep 15, 2026 | 15 |
| Sep 14, 2026 | 15 |
| Sep 13, 2026 | 15 |
| Sep 12, 2026 | 15 |
| Sep 11, 2026 | 15 |
| Sep 10, 2026 | 15 |
| Sep 9, 2026 | 15 |
| Sep 8, 2026 | 15 |
| Sep 7, 2026 | 15 |
Shared by 12 plugins in what-works-global/payload-packages.
222+135 since Sep 7
| Date | Weekly downloads |
|---|---|
| Dec 6, 2026 | 222 |
| Dec 5, 2026 | 267 |
| Dec 4, 2026 | 302 |
| Dec 3, 2026 | 270 |
| Dec 2, 2026 | 279 |
| Dec 1, 2026 | 309 |
| Nov 30, 2026 | 308 |
| Nov 29, 2026 | 263 |
| Nov 28, 2026 | 211 |
| Nov 27, 2026 | 179 |
| Nov 26, 2026 | 198 |
| Nov 25, 2026 | 207 |
| Nov 24, 2026 | 220 |
| Nov 23, 2026 | 220 |
| Nov 22, 2026 | 249 |
| Nov 21, 2026 | 254 |
| Nov 20, 2026 | 344 |
| Nov 19, 2026 | 313 |
| Nov 18, 2026 | 380 |
| Nov 17, 2026 | 340 |
| Nov 16, 2026 | 348 |
| Nov 15, 2026 | 358 |
| Nov 14, 2026 | 386 |
| Nov 13, 2026 | 326 |
| Nov 12, 2026 | 303 |
| Nov 11, 2026 | 258 |
| Nov 10, 2026 | 291 |
| Nov 9, 2026 | 296 |
| Nov 8, 2026 | 268 |
| Nov 7, 2026 | 243 |
| Nov 6, 2026 | 208 |
| Nov 5, 2026 | 205 |
| Nov 4, 2026 | 197 |
| Nov 3, 2026 | 167 |
| Nov 2, 2026 | 155 |
| Nov 1, 2026 | 143 |
| Oct 31, 2026 | 130 |
| Oct 30, 2026 | 125 |
| Oct 29, 2026 | 97 |
| Oct 28, 2026 | 31 |
| Oct 27, 2026 | 29 |
| Oct 26, 2026 | 28 |
| Oct 25, 2026 | 40 |
| Oct 24, 2026 | 34 |
| Oct 23, 2026 | 23 |
| Oct 22, 2026 | 38 |
| Oct 21, 2026 | 46 |
| Oct 20, 2026 | 43 |
| Oct 19, 2026 | 42 |
| Oct 18, 2026 | 40 |
| Oct 17, 2026 | 86 |
| Oct 16, 2026 | 89 |
| Oct 15, 2026 | 95 |
| Oct 14, 2026 | 113 |
| Oct 13, 2026 | 110 |
| Oct 12, 2026 | 110 |
| Oct 11, 2026 | 123 |
| Oct 10, 2026 | 85 |
| Oct 9, 2026 | 103 |
| Oct 8, 2026 | 94 |
| Oct 7, 2026 | 72 |
| Oct 6, 2026 | 76 |
| Oct 5, 2026 | 76 |
| Oct 4, 2026 | 51 |
| Oct 3, 2026 | 53 |
| Oct 2, 2026 | 32 |
| Oct 1, 2026 | 31 |
| Sep 30, 2026 | 30 |
| Sep 29, 2026 | 27 |
| Sep 28, 2026 | 27 |
| Sep 27, 2026 | 28 |
| Sep 26, 2026 | 22 |
| Sep 25, 2026 | 23 |
| Sep 24, 2026 | 18 |
| Sep 23, 2026 | 25 |
| Sep 22, 2026 | 25 |
| Sep 21, 2026 | 29 |
| Sep 20, 2026 | 29 |
| Sep 19, 2026 | 28 |
| Sep 18, 2026 | 29 |
| Sep 17, 2026 | 25 |
| Sep 16, 2026 | 36 |
| Sep 15, 2026 | 65 |
| Sep 14, 2026 | 61 |
| Sep 13, 2026 | 81 |
| Sep 12, 2026 | 81 |
| Sep 11, 2026 | 81 |
| Sep 10, 2026 | 118 |
| Sep 9, 2026 | 98 |
| Sep 8, 2026 | 85 |
| Sep 7, 2026 | 87 |
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/1064440892-activity-log)<a href="https://payloaddirectory.dev/plugins/1064440892-activity-log"><img src="https://payloaddirectory.dev/badge/1064440892-activity-log.svg" alt="Payload Directory"></a>README
Payload plugin that records a chronological activity feed for your whole CMS — who did what, when, across every collection and global. Think WordPress's Simple History, for Payload.
@whatworks/payload-audit-fields: reuses its resolveUserLabel automatically so both plugins display users identically, and keeps its attribution fields out of the changed-fields noise.

pnpm add @whatworks/payload-activity-log
import { activityLogPlugin } from '@whatworks/payload-activity-log'
import { buildConfig } from 'payload'
export default buildConfig({
// ...
plugins: [
// Register last so collections added by other plugins are logged too.
activityLogPlugin(),
],
})
Then regenerate the import map so the admin panel can resolve the plugin's components:
payload generate:importmap
An Activity Log collection appears in the admin panel: a reverse-chronological feed with linked users, linked documents, the operation, and a link to the version diff for each change.
activityLogPlugin({
// Which collections to log. Defaults to all (the log collection itself is
// always excluded).
// - true — every collection (default)
// - ['posts', 'pages'] — only these
// - { exclude: ['redirects'] } — all except these
collections: { exclude: ['redirects'] },
// Which globals to log. Same semantics. Defaults to all.
globals: true,
// Per-event toggles (all default true except autosave).
events: {
create: true,
update: true,
trash: true, // moving to the trash (collections with trash: true)
restore: true, // restoring from the trash
delete: true, // permanent deletion
login: true,
logout: true,
autosave: false, // default false — autosaves fire every few seconds while editing
},
// When to store a full JSON snapshot of the affected document, configured
// separately for collections and globals. A snapshot is a fallback for the
// version link — worth storing only when a durable version won't be there to
// recover the data from. Each scope takes a single mode, or { default, overrides }
// to tune individual slugs.
// 'never' — never store document data.
// 'delete' — (collections only) on permanent delete, the sole surviving record.
// 'fallback' — on delete, plus every change to an entity with NO versions
// enabled; versioned entities rely on the version link instead.
// 'always' — on every change (watch your database size).
// Defaults: collections 'delete', globals 'never'.
snapshot: {
collections: 'delete',
globals: { default: 'never', overrides: { 'site-settings': 'always' } },
},
// Opt-in IP address tracking. When enabled, an `ipAddress` field is added to
// the log collection and every entry stores the requester's address.
// `true` reads the standard reverse-proxy headers (`cf-connecting-ip` →
// `x-real-ip` → first `x-forwarded-for` entry); pass a function to resolve it
// yourself when your proxy chain makes those untrustworthy. IP addresses are
// personal data under most privacy regimes — consider pairing with `retention`.
ipAddress: false,
// Opt-in request host tracking. When enabled, a `requestHost` field is added
// to the log collection and every entry stores the host the request was
// addressed to. `true` reads the standard headers (`x-forwarded-host` →
// `host`); pass a function to resolve it yourself when your proxy chain makes
// those untrustworthy. Handy for multi-tenant / multi-domain deployments.
requestHost: false,
// Delete entries older than this. Off by default — nothing is pruned unless
// you opt in. Pruning runs after log writes, at most once per hour.
retention: { maxAgeDays: 90 },
// Slug of the log collection. Default 'activity-log'.
collectionSlug: 'activity-log',
// Escape hatch for the generated collection — access control, labels, admin
// options, extra fields.
collectionOverride: (collection) => ({
...collection,
access: { ...collection.access, read: ({ req }) => req.user?.role === 'admin' },
}),
// Auth collections whose users can appear as actors (and whose logins/logouts
// are logged). Defaults to every auth-enabled collection in your config.
userCollections: ['users'],
// Custom actor resolution, e.g. attribute job/webhook writes to a bot user.
// Return null/undefined to skip logging that event.
resolveUser: ({ req }) =>
req.user ? { relationTo: req.user.collection, value: req.user.id } : null,
// Label stored for the acting user at event time. May be async.
// Defaults to email → username → ID, or to audit-fields' resolveUserLabel
// when that plugin is registered.
resolveUserLabel: ({ user }) => user.email as string,
// Title stored for the affected document at event time. May be async.
// Defaults to the collection's useAsTitle value → title → name → email →
// username → ID; for globals, the global's label.
resolveDocumentLabel: ({ doc }) => doc.title as string,
})
req.user. Writes without a user (seeds, migrations, job runners, local API calls without user) are not logged — pass resolveUser to attribute them to a dedicated system user instead.trash: true, moving to the trash logs trash (linked to the document under the trash route), restoring logs restore, and emptying the trash logs delete with a snapshot. Payload introduced trash in 3.49 — on older versions within the supported peer range these events simply never occur (there is no trash), and everything else works as described.events.autosave: true to log every autosave.ipAddress. When enabled, every entry (all operations, not just logins) records the requesting client's address; resolution failures simply leave it unset. Which proxy headers can be trusted depends on your deployment — pass a resolver function if the defaults pick up spoofable values.requestHost. When enabled, every entry records the host the request was addressed to (x-forwarded-host → host by default), which is useful for attributing activity across multi-tenant or multi-domain deployments. As with ipAddress, resolution failures leave it unset and forwarded headers are only as trustworthy as your proxy chain — pass a resolver function if the defaults pick up spoofable values.collectionOverride. Note that stored labels/titles are visible to anyone who can read the log, regardless of their access to the source documents.Payload saves a change's version before afterChange hooks run, so each log entry can record the ID of the exact version its change produced. The Version column links straight to that version's diff view. For entities without versions the column shows —, and the entry's changed-field names still tell you what was touched.
Cells only link to destinations that still resolve: once a document is permanently deleted (its versions are deleted with it) the version cell shows a muted "Document deleted" and the document cell shows the stored title without a link; a version pruned by versions.maxPerDoc shows —. The actor gets the same treatment — a deleted user's label loses its link (in the list and on the entry view). Documents and users sitting in the trash link under the trash route. The existence checks are batched per render pass — one query per collection for a whole page of rows, not one per cell — and the actor checks share the same batch.
A snapshot is a full JSON copy of the affected document, stored on the log entry. It's a fallback for the version link — the plugin prefers to link to the version a change produced rather than duplicate data, and only stores a snapshot when a durable version won't be there to recover from. There are exactly two such cases: a permanent delete (Payload deletes a document's versions with it) and an entity with no versions enabled (there's no version to link to).
The four modes form a ladder from least to most stored — never < delete < fallback < always — set per scope:
| mode | on change (create/update/trash/restore) | on permanent delete |
|---|---|---|
never | — | — |
delete | — | snapshot |
fallback | snapshot iff the entity has no versions | snapshot |
always | snapshot | snapshot |
'delete' — the version link carries normal change history; the snapshot only fills the one gap deletes leave.'never' — globals can't be deleted, so there's no delete gap to fill, and versioned globals are already covered by the version link. Opt individual globals in with 'fallback' (unversioned globals) or 'always', e.g. globals: { default: 'never', overrides: { 'site-settings': 'always' } }. 'delete' is not a valid global mode.'never' is still logged (actor, changed fields, version link) — it just stores no JSON copy.The two plugins are independent but designed to compose. Register both (order doesn't matter):
plugins: [auditFieldsPlugin(), activityLogPlugin()]
resolveUserLabel (unless you pass its own), so users display identically everywhere.createdBy/lastModifiedBy are excluded from changedFields.This plugin is a rethink rather than a drop-in replacement (field names and stored shapes differ):
data json copy of the whole document on every change — entries link to the version diff instead; snapshots only on permanent delete (configurable).resolveUser returns one) — instead of being skipped wholesale.audit fields
Track who created and last modified each document, with a Modified By column in the versions view
62176/wk16v3
payload plugin audit
Audit trail for Payload collections that records who created or updated documents and stores update deltas
6134/wk1v3
payload sentinel
Audit logger that records user create, update and delete operations in a central collection
5115/wk10v3
authors info
Automatically record who created, edited and published documents across collections and globals
59277/wk183v3
payload plugin author fields
Adds createdBy and updatedBy fields to all collections and globals in a Payload app
3676/wk43v1 v2
audit fields
Adds createdBy and lastModifiedBy fields to Payload collections and globals
922.3k/wk115v4