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.The Replyke entity ID to comment on.
The Replyke user ID of the comment author.
The comment text content.
Your application’s identifier for this comment.
The Replyke comment ID of the parent, for creating a reply.
A comment being directly quoted or referenced.
File or media attachments on the comment.
Arbitrary metadata attached to the comment.
ISO 8601 timestamp to backdate the comment’s creation time.
ISO 8601 timestamp to backdate the comment’s last update time.
Promise<Comment>
fetchComment
Fetches a single comment by its Replyke ID.The Replyke comment ID.
Promise<Comment>
fetchCommentByForeignId
Fetches a comment by your application’s own identifier.Your application’s comment identifier.
Promise<Comment>
updateComment
Updates the content or timestamp of an existing comment.The Replyke comment ID to update.
The new comment text.
Override the creation timestamp (ISO 8601). Useful for data migrations.
Promise<Comment>
deleteComment
Permanently deletes a comment.The Replyke comment ID to delete.
Promise<void>
fetchManyComments
Fetches a paginated list of comments on an entity. Supports top-level and reply-level fetching.The Replyke entity ID to fetch comments for.
When provided, fetches replies to this specific comment ID instead of top-level comments.
Page number (1-indexed). Defaults to
1.Results per page. Defaults to
20.Sort order:
"top" (highest scored), "new" (most recent first), or "old" (oldest first).Promise<PaginatedResponse<Comment>>
addReaction
Adds a reaction from a user to a comment.The Replyke comment ID.
The Replyke user ID of the reactor.
One of:
"upvote", "downvote", "like", "love", "wow", "sad", "angry", "funny".Promise<Reaction>
removeReaction
Removes a user’s existing reaction from a comment.The Replyke comment ID.
The Replyke user ID whose reaction to remove.
Promise<void>
fetchReactions
Fetches a paginated list of reactions on a comment, optionally filtered by reaction type.The Replyke comment ID.
Filter to a specific reaction type.
Page number (1-indexed). Defaults to
1.Results per page. Defaults to
20.Promise<PaginatedResponse<Reaction>>
getUserReaction
Checks what reaction (if any) a specific user has left on a comment.The Replyke comment ID.
The Replyke user ID to check.
Promise<{ reactionType: ReactionType | null }>
