comments module provides full server-side control over comments on entities. Use it to seed content, build moderation pipelines, or integrate comment data into your backend logic.
createComment
Creates a new comment on an entity.Promise<Comment>
fetchComment
Fetches a single comment by its Sublay ID.Promise<Comment>
fetchCommentByForeignId
Fetches a comment by your application’s own identifier.Promise<Comment>
updateComment
Updates the content of an existing comment.Promise<Comment>
deleteComment
Permanently deletes a comment.Promise<void>
fetchManyComments
Fetches a paginated list of comments on an entity. Supports top-level and reply-level fetching.Sort order:
"createdAt" (newest first; honors sortDir), "top" (highest scored), or "controversial". "new" (createdAt DESC) and "old" (createdAt ASC) are deprecated aliases for "createdAt" (removed in v8) — the server still accepts them but responds with a deprecation header.How to treat comments authored by users the viewer is block-edged with.
"exclude" (default) hides them; "include-outbound-blocked" re-includes only the viewer’s own outbound-blocked authors — never content from users who blocked the viewer. No effect without the moderation bundle.Promise<PaginatedResponse<Comment>>
addReaction
Adds a reaction from a user to a comment.Promise<Reaction>
removeReaction
Removes a user’s existing reaction from a comment.Promise<void>
fetchReactions
Fetches a paginated list of reactions on a comment, optionally filtered by reaction type.Promise<PaginatedResponse<Reaction>>
getUserReaction
Checks what reaction (if any) a specific user has left on a comment.Promise<{ reactionType: ReactionType | null }>
