gecut

payload preset

by gecut
nexload-sdk
Other
v3
>=3.85.0 <4.0.0
MIT

Overview

Summary generated from the README

Bundles five Nexload plugins behind one nexloadPreset() call that returns a plugin array for buildConfig. It adds Persian i18n and Tehran timezone defaults, bridges the SDK logger to Payload's logger, installs after-commit hooks, adds a slug generation endpoint, and writes audit entries. Each plugin can be disabled or configured individually. Requires Payload 3.85 or later, React 19 and Node.js.

Features

  • Persian i18n, Asia/Tehran timezone and RTL defaults for existing fa locales
  • Bridges the SDK logger with redaction and serializers to Payload's logger
  • After-commit hook so audit entries and revalidation run once a transaction commits
  • Audit logging of create, update, delete and auth operations, recording identifiers and counts
  • Slug generation endpoint with configurable access control
  • Per-plugin options or false to disable any part of the preset

Use cases

  • Standardise buildConfig setup across several Payload projects targeting Persian or Iranian audiences
  • Add audit trails to collections without writing custom hooks
  • Route Payload logs through a shared structured logger

Installation

npm i @nexload-sdk/payload-preset

3

Stars

0

Forks

0

Open Issues

Yesterday

Last Updated

232

Weekly Downloads

v1.1.0

npm Version

23.1 KB

Unpacked Size

4

Dependencies

Repository stars

3+2 since Sep 7

Show data
Repository stars by day (UTC)
DateStars
Dec 6, 20263
Dec 5, 20263
Dec 4, 20263
Dec 3, 20263
Dec 2, 20263
Dec 1, 20263
Nov 30, 20263
Nov 29, 20263
Nov 28, 20263
Nov 27, 20263
Nov 26, 20263
Nov 25, 20263
Nov 24, 20263
Nov 23, 20263
Nov 22, 20263
Nov 21, 20263
Nov 20, 20263
Nov 19, 20263
Nov 18, 20263
Nov 17, 20262
Nov 16, 20262
Nov 15, 20262
Nov 14, 20262
Nov 13, 20262
Nov 12, 20262
Nov 11, 20262
Nov 10, 20262
Nov 9, 20262
Nov 8, 20262
Nov 7, 20262
Nov 6, 20262
Nov 5, 20262
Nov 4, 20262
Nov 3, 20262
Nov 2, 20262
Nov 1, 20262
Oct 31, 20262
Oct 30, 20262
Oct 29, 20262
Oct 28, 20262
Oct 27, 20262
Oct 26, 20262
Oct 25, 20262
Oct 24, 20262
Oct 23, 20262
Oct 22, 20262
Oct 21, 20262
Oct 20, 20262
Oct 19, 20262
Oct 18, 20262
Oct 17, 20261
Oct 16, 20261
Oct 15, 20261
Oct 14, 20261
Oct 13, 20261
Oct 12, 20261
Oct 11, 20261
Oct 10, 20261
Oct 9, 20261
Oct 8, 20261
Oct 7, 20261
Oct 6, 20261
Oct 5, 20261
Oct 4, 20261
Oct 3, 20261
Oct 2, 20261
Oct 1, 20261
Sep 30, 20261
Sep 29, 20261
Sep 28, 20261
Sep 27, 20261
Sep 26, 20261
Sep 25, 20261
Sep 24, 20261
Sep 23, 20261
Sep 22, 20261
Sep 21, 20261
Sep 20, 20261
Sep 19, 20261
Sep 18, 20261
Sep 17, 20261
Sep 16, 20261
Sep 15, 20261
Sep 14, 20261
Sep 13, 20261
Sep 12, 20261
Sep 11, 20261
Sep 10, 20261
Sep 9, 20261
Sep 8, 20261
Sep 7, 20261

Shared by 8 plugins in gecut/nexload-sdk.

npm weekly downloads

232+232 since Nov 26

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 6, 2026232
Dec 5, 202662
Dec 4, 2026249
Dec 3, 2026246
Dec 2, 2026243
Dec 1, 2026235
Nov 30, 2026229
Nov 29, 2026211
Nov 28, 2026195
Nov 27, 20260
Nov 26, 20260

Each point is npm's rolling 7-day download count.

Health Score

76/100Excellent

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-preset.svg)](https://payloaddirectory.dev/plugins/1086380959-payload-preset)
HTML
<a href="https://payloaddirectory.dev/plugins/1086380959-payload-preset"><img src="https://payloaddirectory.dev/badge/1086380959-payload-preset.svg" alt="Payload Directory"></a>
Updated Dec 4, 2026Created Oct 30, 2025Published Dec 3, 2026

README

@nexload-sdk/payload-preset

Composed Payload CMS preset for Persian admin defaults, SDK logger bridging, field hooks, and audit logging.

npm version License: MIT Module: ESM Runtime: Node | Payload 3

[!IMPORTANT] Version 1.0.0 is pending initial release in .changeset/payload-preset-initial.md and is not published to npm yet.

Table of contents

Overview

@nexload-sdk/payload-preset bundles five Nexload Payload plugins behind a single nexloadPreset() call: persianPlugin(), payloadLoggerPlugin(), afterCommitPlugin(), payloadFieldsPlugin(), and auditPlugin(). It solves repetitive top-level buildConfig() wiring across Payload CMS projects targeting Persian/Iranian setups. It is for Payload 3 server configurations running on Node.js.

What it is not:

  • Not a collection or field schema generator (use @nexload-sdk/payload-fields and @nexload-sdk/payload-schema).
  • Not an admin branding or font package; set admin.components.graphics.Logo, Icon, and fonts in your host app.
  • Not a localization enabler; persianPlugin() never adds localization.locales or enables document localization on its own.

Philosophy

Audit logs identifiers and counts, not bodies, emails, or tokens; read auditing is off by default. getPayloadLoggerConfig() supplies SDK redaction, serializers, request context, formatting, and any explicit destination to Payload’s logger.

  • Merge, never overwrite: persianPlugin() and payloadLoggerPlugin() preserve host-configured languages, timezones, and config.logger.
  • Top-level config only: Plugins adjust i18n, admin.timezones, logger, existing fa locale objects (rtl), collection and global hooks, and add the /payload-fields/generate-slug endpoint without mutating field definitions.
  • Explicit plugin ordering: payloadFieldsPlugin (900) and auditPlugin (1000) run after default-order plugins so collections added by other plugins are covered.
flowchart LR
  P["persianPlugin (i18n + Tehran TZ)"] --> L["payloadLoggerPlugin (config.logger)"]
  L --> C["afterCommitPlugin (onInit)"]
  C --> F["payloadFieldsPlugin (order: 900)"]
  F --> A["auditPlugin (order: 1000)"]

Install

pnpm add @nexload-sdk/payload-preset payload @payloadcms/translations @payloadcms/ui react react-dom
# or
npm install @nexload-sdk/payload-preset payload @payloadcms/translations @payloadcms/ui react react-dom
# or
yarn add @nexload-sdk/payload-preset payload @payloadcms/translations @payloadcms/ui react react-dom
# or
bun add @nexload-sdk/payload-preset payload @payloadcms/translations @payloadcms/ui react react-dom
PackageRangeRequired / Optional
payload>=3.85.0 <4.0.0Required
@payloadcms/translations>=3.85.0 <4.0.0Required
@payloadcms/ui>=3.85.0 <4.0.0Required (admin components of payloadFieldsPlugin)
react^19.0.1 || ^19.1.2 || ^19.2.1Required (admin components of payloadFieldsPlugin)
react-dom^19.0.1 || ^19.1.2 || ^19.2.1Required (admin components of payloadFieldsPlugin)

Quick start

import { configureLogger } from "@nexload-sdk/logger";
import { nexloadPreset } from "@nexload-sdk/payload-preset";
import { buildConfig } from "payload";

configureLogger({ service: "shop-cms" }); // Must run before buildConfig()

export default buildConfig({
  // Add db, secret, and collections here.
  plugins: [...nexloadPreset()],
});

Usage

Customizing or disabling preset plugins

Pass false (or afterCommit: false) to disable any individual plugin, or pass options directly to fields or audit:

import { nexloadPreset } from "@nexload-sdk/payload-preset";

export const plugins = nexloadPreset({
  persian: true,
  logger: true,
  fields: {
    generateSlugAccess: ({ req }) => Boolean(req.user),
  },
  audit: {
    operations: ["create", "update", "delete", "auth"],
  },
});

Composing individual plugins

You can also import persianPlugin and payloadLoggerPlugin directly without nexloadPreset():

import { payloadLoggerPlugin, persianPlugin } from "@nexload-sdk/payload-preset";

export const plugins = [persianPlugin(), payloadLoggerPlugin()];

Admin branding and fonts (DIY)

  • Branding: Set Payload's admin.components.graphics.Logo and admin.components.graphics.Icon to your own component paths in buildConfig.
  • Fonts: Load your font in app/(payload)/layout.tsx and apply its class to the Payload layout in your host app.

API

Root entry (@nexload-sdk/payload-preset)

ExportKindSummary
nexloadPresetfunctionReturns Plugin[] combining Persian, logger, after-commit, fields, and audit plugins
persianPluginfunctionAdds fa translation support, Asia/Tehran timezone, and fa RTL defaults
payloadLoggerPluginfunctionApplies getPayloadLoggerConfig() when config.logger is undefined
NexloadPresetOptionstypeOptions object accepted by nexloadPreset
AuditOperationtypeRe-exported from @nexload-sdk/payload-hooks
AuditPluginOptionstypeRe-exported from @nexload-sdk/payload-hooks

Configuration

OptionTypeDefaultDescription
persianbooleantrueEnables persianPlugin()
loggerbooleantrueEnables payloadLoggerPlugin() when config.logger is unset
fieldsfalse | PayloadFieldsPluginOptions{}Options for payloadFieldsPlugin, or false to disable
auditfalse | AuditPluginOptions{}Options for auditPlugin, or false to disable
afterCommitbooleantrueInstalls afterCommitPlugin() from @nexload-sdk/payload-hooks; false leaves it out

afterCommitPlugin() is what makes runAfterCommit usable in app code, lets @nexload-sdk/payload-revalidate send batches exactly on commit, and makes auditPlugin write change and delete entries after the transaction commits. Pass afterCommit: false to opt out; then revalidation falls back to its bounded wait and audit entries are written immediately. The plugin runs in onInit and has no order.

Runtime and compatibility

  • Module format: ESM-only (type: "module").
  • Runtime: Node.js Payload configuration only.
  • Payload version: payload, @payloadcms/translations and @payloadcms/ui >=3.85.0 <4.0.0; React 19 (react, react-dom).

Caveats

[!WARNING] Call configureLogger() before buildConfig(). payloadLoggerPlugin() only forwards an explicit destination stream, so in development Payload writes JSON unless configureLogger({ destination }) is provided. Payload's logger uses standard Pino levels and has no success() method; the SDK's success threshold maps to warn. Forced SDK reconfigurations require rebuilding the Payload config.

[!WARNING] Payload creates its implicit default users auth collection after plugins run, so auditPlugin cannot target it. Declare your auth collection explicitly to audit auth and write events, and note that without afterCommitPlugin() (the preset installs it unless afterCommit: false) write hooks fire before transaction commit, so an audit entry may describe a change that was rolled back and did not persist (see payload-hooks).

[!NOTE] persianPlugin() only sets rtl: true on existing fa locale objects that leave rtl undefined; string-array locales and existing rtl values are left untouched.

  • logger — Global structured logger bridged by payloadLoggerPlugin
  • payload-fields — Field factories and payloadFieldsPlugin (order: 900)
  • payload-hooks — Collection auditPlugin (order: 1000)
  • persian — Provides TEHRAN_TIME_ZONE

Agent skills

This package ships agent skills that match its version. After install they are at node_modules/@nexload-sdk/payload-preset/skills/:

  • payload-preset — skills/payload-preset/SKILL.md

Point your coding agent at them from AGENTS.md, or install from the repository with npx skills add gecut/nexload-sdk --skill <name>.

License

MIT

Similar plugins