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.

Usage Example

Parameters

string
required
The short ID to look up. This is the value from entity.shortId.
string | EntityInclude[]
Optional. Populate related fields. 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.