Requires the
entities bundle. A project without the entities bundle returns 403 database/tables-not-available for entity calls. See Bundles.entities module gives you full server-side control over their lifecycle.
createEntity
Creates a new entity.Your application’s identifier for this entity. Used for idempotent lookups via
fetchEntityByForeignId.The entity’s own NSFW flag. Defaults to
false. Effective NSFW also inherits from the entity’s space. See Entity NSFW flagging.Promise<Entity>
fetchEntity
Fetches a single entity by its Sublay ID.Promise<Entity>
fetchEntityByForeignId
Fetches an entity by your application’s own identifier. Optionally creates it if not found.Promise<Entity>
fetchEntityByShortId
Fetches an entity by its short, human-readable ID (used in share URLs).Promise<Entity>
fetchManyEntities
Fetches a filtered, paginated list of entities. Supports rich filtering by metadata, keywords, location, and more.Sort order:
"createdAt" (chronological — honors sortDir), "hot" (trending), "top" (highest scored), or "controversial". A "metadata.<prop>" value is also accepted to sort by a metadata field.Sort by the count of a specific reaction:
"upvote", "downvote", "like", "love", "wow", "sad", "angry", or "funny".Filter by metadata fields:
{ includes?, includesAny?, doesNotInclude?, exists?: string[], doesNotExist?: string[] }.Filter by title:
{ hasTitle?: "true" | "false"; includes?: string | string[]; doesNotInclude?: string | string[] }.Filter by content:
{ hasContent?: "true" | "false"; includes?: string | string[]; doesNotInclude?: string | string[] }.Filter by effective NSFW (
entity.nsfw OR its space's nsfwEffective). "include-all" (default) adds no predicate; "exclude" drops effective-NSFW entities; "only" returns only them. See Entity NSFW flagging.How to treat entities 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<Entity>>
updateEntity
Updates fields on an existing entity.Updated NSFW own-flag (owner / service). A space moderator flagging another user’s entity uses
spaces.setSpaceEntityNsfw instead. See Entity NSFW flagging.Promise<Entity>
deleteEntity
Permanently deletes an entity and its associated data. Deleting a published entity takes back the author’s reputation for creating it, once: not for a draft, and not again for one already soft-deleted.Promise<void>
incrementEntityViews
Increments the view counter on an entity. Call this when a user views content to track engagement.Promise<Entity>
fetchDrafts
Fetches a user’s unpublished draft entities.Promise<PaginatedResponse<Entity>>
publishDraft
Publishes a draft entity, making it publicly visible.Promise<Entity>
fetchTopComment
Fetches the highest-scored (top) comment on an entity. Returnsnull if the entity has no comments.
Promise<TopComment | null>
addReaction
Adds a reaction from a user to an entity.Promise<Reaction>
removeReaction
Removes a user’s existing reaction from an entity.Promise<void>
fetchReactions
Fetches a paginated list of reactions on an entity, optionally filtered by reaction type.Promise<PaginatedResponse<Reaction>>
getUserReaction
Checks what reaction (if any) a specific user has left on an entity.Promise<{ reactionType: ReactionType | null }>
isEntitySaved
Checks whether a user has saved an entity to any of their collections.Promise<{ isSaved: boolean }>
