gecut

payload hooks

by gecut
nexload-sdk
Logging & monitoring
v?
catalog:

Overview

Summary generated from the README

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.

Features

  • logOperation helper for collection hooks
  • Supports beforeChange, afterChange, afterDelete and afterRead
  • Logs collection slug and hook type via @nexload-sdk/logger
  • Passes through data or doc without modifying it

Use cases

  • Trace which collection operations run during development
  • Add simple operation logging to a collection without writing custom hooks

From the author

Effortless, type-safe logging for Payload CMS collection operations.

Installation

npm i @nexload-sdk/payload-hooks

2

Stars

0

Forks

0

Open Issues

Today

Last Updated

27

Weekly Downloads

v2.1.0

npm Version

8.9 KB

Unpacked Size

2

Dependencies

Repository stars

Trends appear after 7 days of data. Collecting since Oct 22 — 1 daily snapshot so far.

Shared by 4 plugins in gecut/nexload-sdk.

npm weekly downloads

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

62/100Good

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/1086380959-payload-hooks.svg)](https://payloaddirectory.dev/plugins/1086380959-payload-hooks)
HTML
<a href="https://payloaddirectory.dev/plugins/1086380959-payload-hooks"><img src="https://payloaddirectory.dev/badge/1086380959-payload-hooks.svg" alt="Payload Directory"></a>
Updated Oct 22, 2026Created Oct 30, 2025Published Jul 20, 2026

README

@nexload-sdk/payload-hooks

Small Payload CMS hook helpers built on top of @nexload-sdk/logger.

Install

pnpm add @nexload-sdk/payload-hooks

Exports

  • logOperation(hookType)

Quick Start

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")]
  }
};

Supported Hook Types

  • beforeChange
  • afterChange
  • afterDelete
  • afterRead

Behavior

The returned hook logs the collection slug/name and hook type using @nexload-sdk/logger, then returns:

  • args.data when present
  • args.doc when present
  • null otherwise

Similar plugins