Skip to main content
useCommentThread(type, id, { sort?, perPage?, client? }) is the store both batteries-included threads run on.
  • React spreads state into the return value (comments, status, …).
  • Vue nests it under state (state.comments, state.status).
type is the commentable alias. id is the record key.

State

A comment held for moderation is decorated with pending: true (pending ?? !is_approved) so you can show it to its author while it waits. comment.can.update and comment.can.delete mirror CommentPolicy. comment.can.pin is true for parent comments when the current user is a moderator and pins are enabled. comment.can.accept is true for replies on a Q&A thread when the visitor is the page author or a moderator.

Actions

All return promises. Writes apply optimistically and roll back if the request fails. The result also includes store (ThreadStore) if you need subscribeToThread() for Reverb, store.postAnyway(), or store.toggleAccept().

CommentifyClient

Methods: listComments, createComment, updateComment, deleteComment, toggleLike, report, ui, uploadMedia, pinComment, unpinComment, acceptComment, unacceptComment, checkDuplicates, previewMarkdown, searchUsers, listReplies. createComment accepts optional { guest_name, guest_email }. Guest likes/reports do not need extra fields. The server keys on IP + user agent.

Errors

Failures throw ApiError with status, message, errors, and a stable code. Switch on code, not the message: See API for request shapes.
Last modified on November 1, 2026