Skip to main content
An entity is the fundamental content unit in Replyke. It represents whatever your app centers around — a blog post, a product listing, a forum thread, a photo, or any other item that users react to, comment on, collect or vote on. Entities can be:
  • Created from scratch in Replyke or linked to existing items in your system via a foreignId
  • Organized into Spaces for community-based content
  • Published immediately or saved as drafts for later publishing
  • Enriched with file attachments, images, keywords, mentions, location, and custom metadata

How Entities Work

The standard pattern for working with a single entity is via the EntityProvider + useEntity pair. Wrap a component tree with EntityProvider to load and provide entity state, then access that state from any child component using useEntity. For browsing lists of entities, use EntityListProvider + useEntityList. See Entity Lists.

In This Section

EntityProvider & useEntity

Load a single entity by ID, foreign ID, or short ID. Access its state and perform updates and deletes from any child component.

Drafts & Publishing

Create entities as drafts, list the current user’s drafts, and publish them when ready.

Hooks

useCreateEntity

Create a new entity with optional file and image uploads.

useUpdateEntity

Update an entity’s title, content, keywords, attachments, or metadata.

useDeleteEntity

Delete an entity.

The include Parameter

All fetch hooks accept an optional include parameter that populates related data:
ValueWhat it adds
"user"The entity author’s User object
"space"The associated Space object
"topComment"The top-voted comment on this entity
"saved"isSaved: boolean for the current authenticated user
"files"System-managed File objects attached to this entity
const entity = await fetchEntity({ entityId, include: ["user", "topComment"] });

Entity Data Model

See the Entity data model for the complete field reference.