Payload Auditor records events from Payload collection and global hooks into an internal audit log collection. You choose which collections, hooks and operations to track, and can customize log output, collection config and access to logs. Logs can be buffered by size or time, and old logs can be cleaned up through the Payload Jobs system. It targets Payload 3 and has no external dependencies.
Simple, fast and customizable plugin for payload cms
Installation
npm i payload-auditor82
Stars
7
Forks
2
Open Issues
1 months ago
Last Updated
1.4k
Weekly Downloads
v2.0.3
npm Version
89.1 KB
Unpacked Size
0
Dependencies
82+5 since Sep 6
| Date | Stars |
|---|---|
| Dec 5, 2026 | 82 |
| Dec 4, 2026 | 82 |
| Dec 3, 2026 | 82 |
| Dec 2, 2026 | 82 |
| Dec 1, 2026 | 82 |
| Nov 30, 2026 | 82 |
| Nov 29, 2026 | 82 |
| Nov 28, 2026 | 82 |
| Nov 27, 2026 | 82 |
| Nov 26, 2026 | 82 |
| Nov 25, 2026 | 82 |
| Nov 24, 2026 | 82 |
| Nov 23, 2026 | 82 |
| Nov 22, 2026 | 82 |
| Nov 21, 2026 | 82 |
| Nov 20, 2026 | 82 |
| Nov 19, 2026 | 82 |
| Nov 18, 2026 | 82 |
| Nov 17, 2026 | 82 |
| Nov 16, 2026 | 82 |
| Nov 15, 2026 | 82 |
| Nov 14, 2026 | 82 |
| Nov 13, 2026 | 82 |
| Nov 12, 2026 | 82 |
| Nov 11, 2026 | 82 |
| Nov 10, 2026 | 81 |
| Nov 9, 2026 | 81 |
| Nov 8, 2026 | 81 |
| Nov 7, 2026 | 81 |
| Nov 6, 2026 | 81 |
| Nov 5, 2026 | 81 |
| Nov 4, 2026 | 81 |
| Nov 3, 2026 | 80 |
| Nov 2, 2026 | 80 |
| Nov 1, 2026 | 80 |
| Oct 31, 2026 | 80 |
| Oct 30, 2026 | 80 |
| Oct 29, 2026 | 79 |
| Oct 28, 2026 | 79 |
| Oct 27, 2026 | 79 |
| Oct 26, 2026 | 79 |
| Oct 25, 2026 | 79 |
| Oct 24, 2026 | 79 |
| Oct 23, 2026 | 79 |
| Oct 22, 2026 | 79 |
| Oct 21, 2026 | 79 |
| Oct 20, 2026 | 79 |
| Oct 19, 2026 | 79 |
| Oct 18, 2026 | 79 |
| Oct 17, 2026 | 79 |
| Oct 16, 2026 | 79 |
| Oct 15, 2026 | 79 |
| Oct 14, 2026 | 79 |
| Oct 13, 2026 | 79 |
| Oct 12, 2026 | 79 |
| Oct 11, 2026 | 78 |
| Oct 10, 2026 | 78 |
| Oct 9, 2026 | 78 |
| Oct 8, 2026 | 78 |
| Oct 7, 2026 | 78 |
| Oct 6, 2026 | 78 |
| Oct 5, 2026 | 78 |
| Oct 4, 2026 | 78 |
| Oct 3, 2026 | 78 |
| Oct 2, 2026 | 78 |
| Oct 1, 2026 | 78 |
| Sep 30, 2026 | 78 |
| Sep 29, 2026 | 78 |
| Sep 28, 2026 | 78 |
| Sep 27, 2026 | 78 |
| Sep 26, 2026 | 78 |
| Sep 25, 2026 | 78 |
| Sep 24, 2026 | 78 |
| Sep 23, 2026 | 78 |
| Sep 22, 2026 | 78 |
| Sep 21, 2026 | 78 |
| Sep 20, 2026 | 78 |
| Sep 19, 2026 | 78 |
| Sep 18, 2026 | 78 |
| Sep 17, 2026 | 78 |
| Sep 16, 2026 | 78 |
| Sep 15, 2026 | 78 |
| Sep 14, 2026 | 78 |
| Sep 13, 2026 | 78 |
| Sep 12, 2026 | 78 |
| Sep 11, 2026 | 78 |
| Sep 10, 2026 | 77 |
| Sep 9, 2026 | 77 |
| Sep 8, 2026 | 77 |
| Sep 7, 2026 | 77 |
| Sep 6, 2026 | 77 |
1.5K+220 since Sep 6
| Date | Weekly downloads |
|---|---|
| Dec 5, 2026 | 1,496 |
| Dec 4, 2026 | 1,527 |
| Dec 3, 2026 | 1,339 |
| Dec 2, 2026 | 1,266 |
| Dec 1, 2026 | 1,264 |
| Nov 30, 2026 | 1,287 |
| Nov 29, 2026 | 1,486 |
| Nov 28, 2026 | 1,374 |
| Nov 27, 2026 | 1,363 |
| Nov 26, 2026 | 1,522 |
| Nov 25, 2026 | 1,820 |
| Nov 24, 2026 | 1,823 |
| Nov 23, 2026 | 1,859 |
| Nov 22, 2026 | 1,709 |
| Nov 21, 2026 | 1,800 |
| Nov 20, 2026 | 1,915 |
| Nov 19, 2026 | 1,870 |
| Nov 18, 2026 | 1,733 |
| Nov 17, 2026 | 1,748 |
| Nov 16, 2026 | 1,701 |
| Nov 15, 2026 | 1,626 |
| Nov 14, 2026 | 1,629 |
| Nov 13, 2026 | 1,490 |
| Nov 12, 2026 | 1,529 |
| Nov 11, 2026 | 1,410 |
| Nov 10, 2026 | 1,466 |
| Nov 9, 2026 | 1,446 |
| Nov 8, 2026 | 1,443 |
| Nov 7, 2026 | 1,438 |
| Nov 6, 2026 | 1,571 |
| Nov 5, 2026 | 1,621 |
| Nov 4, 2026 | 1,792 |
| Nov 3, 2026 | 1,710 |
| Nov 2, 2026 | 1,761 |
| Nov 1, 2026 | 1,775 |
| Oct 31, 2026 | 1,727 |
| Oct 30, 2026 | 1,756 |
| Oct 29, 2026 | 1,341 |
| Oct 28, 2026 | 942 |
| Oct 27, 2026 | 952 |
| Oct 26, 2026 | 924 |
| Oct 25, 2026 | 1,192 |
| Oct 24, 2026 | 1,366 |
| Oct 23, 2026 | 977 |
| Oct 22, 2026 | 1,377 |
| Oct 21, 2026 | 1,753 |
| Oct 20, 2026 | 1,820 |
| Oct 19, 2026 | 1,899 |
| Oct 18, 2026 | 2,759 |
| Oct 17, 2026 | 2,709 |
| Oct 16, 2026 | 2,980 |
| Oct 15, 2026 | 2,857 |
| Oct 14, 2026 | 2,809 |
| Oct 13, 2026 | 2,779 |
| Oct 12, 2026 | 2,793 |
| Oct 11, 2026 | 1,963 |
| Oct 10, 2026 | 1,807 |
| Oct 9, 2026 | 1,849 |
| Oct 8, 2026 | 2,000 |
| Oct 7, 2026 | 1,919 |
| Oct 6, 2026 | 1,911 |
| Oct 5, 2026 | 1,795 |
| Oct 4, 2026 | 1,458 |
| Oct 3, 2026 | 1,554 |
| Oct 2, 2026 | 1,630 |
| Oct 1, 2026 | 1,544 |
| Sep 30, 2026 | 1,658 |
| Sep 29, 2026 | 1,633 |
| Sep 28, 2026 | 1,620 |
| Sep 27, 2026 | 1,663 |
| Sep 26, 2026 | 1,660 |
| Sep 25, 2026 | 1,452 |
| Sep 24, 2026 | 1,372 |
| Sep 23, 2026 | 1,337 |
| Sep 22, 2026 | 1,363 |
| Sep 21, 2026 | 1,384 |
| Sep 20, 2026 | 1,386 |
| Sep 19, 2026 | 1,419 |
| Sep 18, 2026 | 1,469 |
| Sep 17, 2026 | 1,439 |
| Sep 16, 2026 | 1,265 |
| Sep 15, 2026 | 1,231 |
| Sep 14, 2026 | 1,228 |
| Sep 13, 2026 | 1,179 |
| Sep 12, 2026 | 1,033 |
| Sep 11, 2026 | 965 |
| Sep 10, 2026 | 941 |
| Sep 9, 2026 | 1,095 |
| Sep 8, 2026 | 1,196 |
| Sep 7, 2026 | 1,205 |
| Sep 6, 2026 | 1,276 |
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/967626501-root)<a href="https://payloaddirectory.dev/plugins/967626501-root"><img src="https://payloaddirectory.dev/badge/967626501-root.svg" alt="Payload Directory"></a>README
Payload Auditor is a powerful plugin for Payload CMS that provides centralized event tracking, auditing, and security enhancements. This tool is designed for developers and teams looking to monitor critical actions, analyze user behaviors, and enhance backend security within their Payload projects.
📊 Only ~2 kB (minified + gzipped) and has no external dependencies.
Install with your preferred package manager:
npm install payload-auditor
# or
pnpm add payload-auditor
# or
yarn add payload-auditor
Then, register the plugin in your Payload config:
import { auditorPlugin } from 'payload-auditor'
export default buildConfig({
plugins: [
auditorPlugin({
// your plugin config here
}),
],
})
The plugin is designed in a way that allows you to customize it deeply. Of course, the project is fully documented and you can use its documentation well during development.
Customize the plugin with the following configuration(for example):
auditorPlugin({
automation: {
logCleanup: {
cronTime: '* * * * *', // every minute
queueName: 'john-doe-queue',
},
},
collection: {
trackCollections: [
{
slug: "media",
hooks: {
afterChange: {
update: {
enabled: true,
},
},
},
},
],
},
});
🔒 You can control the accessibility of logs. Due to the increased security of the plugin, other operations are not available.
🛠️ You can manage how logs are injected into the database.
🏷️ You can customize all the plugin's built-in collection values.
📊 You can specify which collections you want to track.
For logging, we have integrated the entire plugin with Payload CMS hooks for each collection that you allow tracking, so you can track the entire application. payload-auditor does logging not based on the hooks themselves, but on the operations inside each hook. Reading the collection hooks documentation can give you a much better understanding of how the plugin works.
🔍 In summary, for each collection, you can make the following changes:
afterOperation hook, only the create operation creates a log.You need to track critical collection changes (e.g., user logins, updates)
You want additional backend security for your Payload project
You work in a multi-user admin environment with role-specific needs
You're building a SaaS or enterprise-grade Payload-based product
Using the plugin is straightforward. Simply specify the slug of the collection or global you want to track, then configure the hooks and operations you need to monitor.
For quick access to the documentation, simply hover over the main API. You can then use the provided link to navigate directly to the relevant documentation.
automationConfigures the automation features of the plugin.
Currently, the plugin supports automatic log cleanup using Payload CMS's Jobs system.
collections & globalsThese are the core sections of the plugin, managing operation tracking. They share a nearly identical API.
Each has a track property that accepts the following configuration:
| Property | Description |
|---|---|
hooks | Defines which hooks to track. |
hooks["hookName"] | The hook name to track. Can be true or a configuration object. |
hooks["hookName"]["operationName"] | The operation to track within the specified hook. Can be true or a configuration object. |
slug | The slug of the collection or global. This value is type-safe. |
hooks["hookName"]) and the operation level (hooks["hookName"]["operationName"]), the following properties are always available:| Property | Description |
|---|---|
customLogger | A custom function to customize the log output. |
debug | Enables debugging for the hook or operation. Can be true or an object. |
When debug: true is enabled for a hook or operation, logs are not saved to the database by default. To override this behavior, set debug.skipDatabaseSave: false. The logs will still be displayed in the console.
If the hook you're tracking does not have operations (e.g., afterRead or afterForgotPassword), the plugin will treat the second-level key as the operation name. For example, forgot-password or read.
When using customLogger, ensure you include the necessary internal collection fields (or custom fields) in your output. The operation and hook values are always overridden by the plugin and are required. The function must return an object.
An enabled property is available at both the hook and operation levels. This allows you to enable or disable tracking for specific hooks or operations.
Setting a hook or operation to false will disable it entirely.
bufferConfigures how logs are flushed to the database. You can control flushing based on either time or log count.
| Property | Description |
|---|---|
flushStrategy | Defines the flushing strategy. Options: - size: Flush when the number of logs reaches the specified limit.- time: Flush after a specified time interval.- realTime: Flush immediately when logs are created. |
size | A numeric value. When the log count reaches this number, logs are flushed. Works with the size strategy. |
time | A numeric value in milliseconds. Logs are flushed at this interval. Works with the time strategy. |
configureRootCollectionA function that allows you to customize the internal collection.
The function receives the default collection configuration as an argument and expects you to return your modified configuration.
audit logs
Read-only audit trail of create, update, delete and login events with field-level diffs and sensitive-field redaction
67660/wk0v3
payload plugin audit
Audit trail for Payload collections that records who created or updated documents and stores update deltas
6134/wk1v3
payload audit
Automatic audit logging for every Payload collection with retention, delegation tracking and multi-tenant scoping
58237/wk5v3
activity log
Record create, update and delete activity on selected collections and globals in a dedicated log collection
87639/wk115v4
payload plugin scheduling
Schedule future publication of drafts on collections and globals with a secured cron endpoint
77783/wk37v3
payload hooks
Identifier-only audit logging hooks for Payload collections, plus a helper to run callbacks after transaction commit
77225/wk3v3