Audit
Automatic, compliance-ready audit logging plugin for Payload CMS that records an immutable change trail across every collection.
Installation
pnpm add @trieb.work/payload-audit About
payload-audit attaches `afterChange` and `afterDelete` hooks to every collection in your Payload config and writes an immutable `audit-logs` entry for each create, update, and delete. One line of configuration covers all collections, with an opt-out list (`disabledCollections`) for anything you do not want audited. Payload's own internal collections (`payload-jobs`, `payload-preferences`, `payload-migrations`, and so on) are excluded by default to avoid noise and feedback loops. The generated `audit-logs` collection denies create, update, and delete through the API. Entries are only written internally by the plugin with `overrideAccess`, so the trail cannot be edited or removed by users. Each entry records the actor (with an email and name snapshot that survives later user deletion), the document id and title, the action type, the IP address, and the user agent. Upload-enabled collections get dedicated `file_upload` and `file_delete` actions instead of generic create and delete. The plugin targets the logging and accountability requirements of frameworks like NIS-2, CRA, GDPR, HIPAA, PCI-DSS 4.0, ISO/IEC 27001, and SOC 2. Optional forensic metadata captures the auth strategy, HTTP method, request path, and a non-reversible token fingerprint (`<prefix8>:<sha256(rest)>`) so you can correlate every action performed with a stolen credential without persisting the raw token. Delegation and impersonation follow RFC 8693 `act` semantics, recording who acted on behalf of whom via `onBehalfOf` and a nested `delegationChain`. Retention is enforced by a Payload scheduled task registered when you set `maxAge` (days) or `maxEntries` (count), with a configurable cron and queue, or a `disableSchedule` flag for manual triggering. Multi-tenant mode adds a `tenant` relationship to each entry, auto-detects the tenant field on your collections, and interoperates with `@payloadcms/plugin-multi-tenant`. The exported helpers `writeAuditLog`, `resolveDelegation`, `extractTenant`, `resolveDocTitle`, and `pruneAuditLogs` let you emit and manage entries from custom hooks and scripts, and a `skipAuditLog` request-context flag suppresses the automatic entry when you write a more specific one yourself. Requires Payload 3.x with the MongoDB adapter.
Package info
- Package name
@trieb.work/payload-audit- Latest version
1.3.0- Unpacked size
- 227 kB
- License
- MIT
- Weekly downloads
- 645
- Last publish
- Sep 9, 2026
More from trieb-work
View profileSimilar plugins
More in AdminSocials
Multi-platform social publishing plugin for Payload 3 with OAuth adapters, scheduling, and audit trails for Pinterest, Instagram, Facebook, and Google Business Profile.
Live Preview
Live preview for Payload CMS in Astro and any SSR/static frontend (SvelteKit, Nuxt, Next.js, plain HTML), patching the DOM without rebuilds.
Dub
A Payload CMS plugin that automatically creates and manages shortlinks using Dub.
SEO
Adds live Yoast SEO analysis to the Payload v3 document editor with a SERP preview, keyphrase checks, and readability scoring.
Info Tooltip
Moves field help text into an info icon beside the admin field label instead of a description under the field.
onpage for TanStack Start
Adds on-page editing and draft previews to TanStack Start sites that read content from Payload.