Skip to main content
Spaces are community containers where users can gather, post content, and interact under customizable rules. Each space has its own membership system, permission levels, moderation tools, and optionally an integrated chat conversation.

In This Section

Provider & Hook

Load a space into context and access its state and operations

Membership

Join/leave spaces, approval workflows, role management

Moderation

Approve or remove content, handle member and content reports

Rules

Create and display community rules for members

Digest & Newsletter

Send periodic content summaries to a webhook endpoint

Space Lists

Browse and paginate spaces with filtering and sorting

Core Architecture

Spaces follow the provider + hook pattern used throughout Replyke. Wrap your space UI with a SpaceProvider and access everything via useSpace.
import { SpaceProvider, useSpace } from "@replyke/react-js";

function SpacePage() {
  return (
    <SpaceProvider spaceId="space-uuid">
      <SpaceContent />
    </SpaceProvider>
  );
}

function SpaceContent() {
  const { space, isMember, canPost, joinSpace } = useSpace();

  if (!space) return <div>Loading...</div>;

  return (
    <div>
      <h1>{space.name}</h1>
      {!isMember && (
        <button onClick={joinSpace}>Join Space</button>
      )}
    </div>
  );
}

Permission Model

Each space has two independent permission settings:
  • readingPermission"anyone" or "members". Controls who can see content.
  • postingPermission"anyone", "members", or "admins". Controls who can post.
When the current user is authenticated and is a member, useSpace exposes their resolved permissions (canPost, canRead, canModerate, isAdmin, isModerator).

Hierarchy

Spaces can be nested up to 10 levels deep. A child space is created by passing a parentSpaceId to useCreateSpace. Only admins of the parent space can create child spaces. Parent admins and moderators are automatically cascaded into new child spaces with their existing roles.

What’s Next

Start with the Provider & Hook to learn how to set up a space in your component tree, then explore membership and moderation features.