Skip to main content
Space moderators and admins can review and act on content in their space. Moderation includes directly approving or removing entities and comments, as well as handling reports submitted by members.

Direct Moderation

Moderators can act on specific entities or comments without a report being filed:
import { useModerateSpaceEntity, useModerateSpaceComment } from "@replyke/react-js";

const moderateEntity = useModerateSpaceEntity();
const moderateComment = useModerateSpaceComment();

// Approve or remove an entity
await moderateEntity({ spaceId, entityId, action: "approve" });
await moderateEntity({ spaceId, entityId, action: "remove" });

// Approve or remove a comment
await moderateComment({ spaceId, commentId, action: "approve" });
await moderateComment({ spaceId, commentId, action: "remove" });
Both hooks require the caller to be a moderator or admin of the space.

Handling Reports

When members report content, moderators receive those reports and can resolve them:
import {
  useHandleSpaceEntityReport,
  useHandleSpaceCommentReport,
} from "@replyke/react-js";

const handleEntityReport = useHandleSpaceEntityReport();
const handleCommentReport = useHandleSpaceCommentReport();

// Dismiss a report or take action
await handleEntityReport({ spaceId, reportId, action: "dismiss" });
await handleEntityReport({ spaceId, reportId, action: "remove_content" });

await handleCommentReport({ spaceId, reportId, action: "dismiss" });
await handleCommentReport({ spaceId, reportId, action: "remove_content" });

Fetching Reports

Use useFetchModeratedReports to retrieve pending reports for a space:
import { useFetchModeratedReports } from "@replyke/react-js";

const fetchReports = useFetchModeratedReports();
const reports = await fetchReports({ spaceId });
Reports appear in the list until they are resolved. Filter by status: "pending" in your UI to show actionable items.

Chat Moderation

Spaces with integrated chat also support message moderation via the API. See the Space Chat API for details on moderating chat messages within a space.

Hook Reference

HookDescription
useModerateSpaceEntityApprove or remove an entity in a space
useModerateSpaceCommentApprove or remove a comment in a space
useFetchModeratedReportsFetch pending content reports
useHandleSpaceEntityReportResolve a reported entity
useHandleSpaceCommentReportResolve a reported comment