Skip to main content
Requires the entities bundle. A project without the entities bundle returns 403 database/tables-not-available. See Bundles.

Overview

useFetchEntityByShortId returns a function that fetches an entity by its shortId — the auto-generated short identifier that Sublay assigns to every entity. Short IDs are useful for building readable sharing URLs. An entity a moderator removed resolves in full for its author and as a placeholder for everyone else.

Usage Example

Parameters

string
required
The short ID to look up. This is the value from entity.shortId.
EntityIncludeParam
Optional. Populate related fields, as a single value or an array. Accepted values: "user", "space", "topComments", "saved", "files", "grants".
number
With "topComments" included: how many top comments per entity. Server default 1, maximum 5. Not sent when include doesn’t contain "topComments".
ReactionType
With "topComments" included: the reaction whose raw count ranks the top comments. Server default "upvote". Not sent when include doesn’t contain "topComments".

Returns

Entity
The fetched entity. See Entity data model.