navanem

payload comments

by navanem
Publishing workflow
v3
^3.88.0
MIT

Overview

Summary generated from the README

Adds a Comments collection, a Comments Settings global and a Comment Statistics admin view to Payload 3. Visitors can comment anonymously with a mood emoji, react to comments and reply up to three levels deep. Comment bodies accept a safe Markdown subset, and approval before publishing can be toggled at runtime. A ready-made React component is included, or you can use the REST API. Requires a salt environment variable for IP hashing.

Features

  • Anonymous comments with name, optional or required email and a mood emoji
  • Safe Markdown comment bodies with no raw HTML rendering
  • Emoji reactions on comments from a configurable set
  • Up to three levels of nested replies
  • Optional pre-publish approval that can be switched at runtime
  • Built-in honeypot, rate limiting and length or link rules

Use cases

  • Add reader comments to blog posts and pages without requiring user accounts
  • Moderate incoming comments from the Payload admin before they go public
  • Review comment volume per collection and mood in a statistics view

From the author

Anonymous comments and reactions plugin for Payload 3.x with optional moderation and 3-level threads.

Installation

npm i @navanem/payload-comments

1

Stars

0

Forks

9

Open Issues

2 weeks ago

Last Updated

0

Weekly Downloads

v

npm Version

Dependencies

GitHub stars

10 since Sep 6

Show data
GitHub stars by day (UTC)
DateStars
Dec 5, 20261
Dec 4, 20261
Dec 3, 20261
Dec 2, 20261
Dec 1, 20261
Nov 30, 20261
Nov 29, 20261
Nov 28, 20261
Nov 27, 20261
Nov 26, 20261
Nov 25, 20261
Nov 24, 20261
Nov 23, 20261
Nov 22, 20261
Nov 21, 20261
Nov 20, 20261
Nov 19, 20261
Nov 18, 20261
Nov 17, 20261
Nov 16, 20261
Nov 15, 20261
Nov 14, 20261
Nov 13, 20261
Nov 12, 20261
Nov 11, 20261
Nov 10, 20261
Nov 9, 20261
Nov 8, 20261
Nov 7, 20261
Nov 6, 20261
Nov 5, 20261
Nov 4, 20261
Nov 3, 20261
Nov 2, 20261
Nov 1, 20261
Oct 31, 20261
Oct 30, 20261
Oct 29, 20261
Oct 28, 20261
Oct 27, 20261
Oct 26, 20261
Oct 25, 20261
Oct 24, 20261
Oct 23, 20261
Oct 22, 20261
Oct 21, 20261
Oct 20, 20261
Oct 19, 20261
Oct 18, 20261
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
Sep 6, 20261
npm weekly downloads

Trends appear after 7 days of data. Daily snapshots have not started yet.

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

Health Score

25/100Fair

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/1273411047-root.svg)](https://payloaddirectory.dev/plugins/1273411047-root)
HTML
<a href="https://payloaddirectory.dev/plugins/1273411047-root"><img src="https://payloaddirectory.dev/badge/1273411047-root.svg" alt="Payload Directory"></a>
Updated Nov 18, 2026Created Jun 18, 2026

README

@navanem/payload-comments

Anonymous comments and reactions for Payload 3.x — with Markdown comment bodies, optional pre-publish moderation, mood emojis, reactions on comments, and up to 3 levels of replies.

Features

  • Anyone can comment (name + optional/required email) with a mood emoji.
  • Comment bodies support a safe subset of Markdown (bold, italic, code, links, lists, blockquotes); raw HTML is never rendered (no XSS).
  • React to existing comments with a configurable emoji set.
  • Optional approval workflow before comments are published — toggleable at runtime.
  • Up to 3 levels of nested replies.
  • Built-in lightweight anti-spam (honeypot, rate limiting, length/link rules).
  • Comments Settings global: enable/disable comments per collection at runtime.
  • Comment Statistics admin view: KPIs, per-collection and per-mood breakdowns, and recent comments, with filters.
  • Ready-to-use <Comments /> React component, or build your own on the REST API.

Screenshots

Front-end

The Comments widget on a live article

The bundled <Comments /> component on a published page: a threaded comment with a Markdown-rendered body, a mood emoji and a date, a reaction row and a reply button, plus the composer (name, optional email, Markdown text and mood).

Moderation (Comments collection)

The comments moderation queue in the Payload admin

Every comment lands in a standard Payload collection, so moderation uses the admin UI you already know. The list is your moderation queue — author, excerpt, a Thread indicator (top-level vs "↳ Reply to <author>"), target document, status and date — with native filtering and bulk actions; approving a pending comment publishes it instantly.

A single comment's detail view in the admin

Opening a comment shows its full record — author and email, mood, the related document and threaded parent, the salted IP/fingerprint hashes used for anti-spam — and the status selector to approve, mark as spam, or trash it.

Settings

The Comments Settings global

The Comments Settings global toggles commenting per collection at runtime and exposes the Require approval switch, so you can turn mandatory pre-publish moderation on or off without a redeploy.

Statistics

The Comment Statistics admin view

The Comment Statistics view: KPIs (totals by status, reaction count, per-day rate), per-collection and per-mood breakdowns, and a recent-comments table — all filterable by collection, status and period, and auth-gated server-side.

Install

pnpm add @navanem/payload-comments
# or from Git until published:
pnpm add github:navanem/payload-comments

payload, react and react-dom are peer dependencies.

Quick start

// payload.config.ts
import { commentsPlugin } from '@navanem/payload-comments'

export default buildConfig({
  // ...
  plugins: [
    commentsPlugin({
      enabledCollections: ['posts', 'pages'],
      requireApproval: true,
      requireEmail: false,
    }),
  ],
})

Set a salt for IP hashing in your environment:

COMMENTS_IP_SALT="a-long-random-string"

Admin: Settings & Statistics

The plugin registers a Comments Settings global (admin group "Comments") where an admin can toggle commenting per collection at runtime. When a collection is disabled, new submissions are rejected and the <Comments /> widget shows a "closed" notice instead of the thread. Unset = every configured collection is enabled (fail-open). The same global has a Require approval checkbox to turn mandatory moderation on/off at runtime; the submit flow reads it live and falls back to the requireApproval option.

It also registers a Comment Statistics view at /admin/comments-statistics (KPIs, per-collection and per-mood breakdowns, and recent comments, filterable by collection / status / period), plus a nav link to it via afterNavLinks. The view queries moderation data server-side and is gated on an authenticated admin user.

The view and nav-link components are referenced through the host import map at the vendored path @/plugins/payload-comments/components/*. If you vendor this plugin under src/plugins/payload-comments, add the matching import-map entries (run payload generate:importmap, or add them by hand). Hosts that ship a custom Nav can ignore the afterNavLinks entry and place the Statistics link themselves.

Front-end

import { Comments } from '@navanem/payload-comments/client'

export default function PostPage({ post }) {
  return <Comments relationTo="posts" docId={post.id} />
}

See docs/frontend-integration.md for props, styling and a no-component (raw API) integration.

Documentation

License

MIT © navanem


Built by navanem and running in production on www.navanem.com.

Similar plugins