Provides a logOperation helper that you attach to Payload collection hooks. It logs the collection slug and hook type using the @nexload-sdk/logger package, then returns the data or doc unchanged. Supported hooks are beforeChange, afterChange, afterDelete and afterRead.
Effortless, type-safe logging for Payload CMS collection operations.
Installation
npm i @nexload-sdk/payload-hooks2
Stars
0
Forks
0
Open Issues
Today
Last Updated
27
Weekly Downloads
v2.1.0
npm Version
8.9 KB
Unpacked Size
2
Dependencies
Trends appear after 7 days of data. Collecting since Oct 22 — 1 daily snapshot so far.
Shared by 4 plugins in gecut/nexload-sdk.
Trends appear after 7 days of data. Collecting since Oct 22 — 1 daily snapshot so far.
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/1086380959-payload-hooks)<a href="https://payloaddirectory.dev/plugins/1086380959-payload-hooks"><img src="https://payloaddirectory.dev/badge/1086380959-payload-hooks.svg" alt="Payload Directory"></a>README
Small Payload CMS hook helpers built on top of @nexload-sdk/logger.
pnpm add @nexload-sdk/payload-hooks
logOperation(hookType)import { logOperation } from "@nexload-sdk/payload-hooks";
export const Posts = {
slug: "posts",
hooks: {
beforeChange: [logOperation("beforeChange")],
afterChange: [logOperation("afterChange")],
afterDelete: [logOperation("afterDelete")],
afterRead: [logOperation("afterRead")]
}
};
beforeChangeafterChangeafterDeleteafterReadThe returned hook logs the collection slug/name and hook type using @nexload-sdk/logger, then returns:
args.data when presentargs.doc when presentnull otherwisesentry
Integrate Sentry error tracking with your Payload application
10018.1k/wk45.4kv3
audit fields
Adds createdBy and lastModifiedBy audit fields to Payload collections and globals
831.2k/wk114v3
activity log
Record activity on selected collections and globals in a dedicated activity log collection
80622/wk114v3
payload auditor
Hook-based audit logging for Payload collections and globals with buffered writes and automatic log cleanup
70858/wk79v3
payload audit
Automatic audit logging for every Payload collection with retention, delegation tracking and multi-tenant scoping
70712/wk4v3
authors info
Automatically record who created, edited and published documents across collections and globals
6557/wk181v3