Skip to main content

Overview

useFetchUser returns a function that fetches a user’s public profile by their Sublay user ID. Use this when you have the user’s id and need to load their profile on demand.

Usage Example

Parameters

The hook returns a function. That function accepts:
userId
string
required
The Sublay user ID to fetch.
include
string | string[]
Optional. Pass "files" to populate avatarFile and bannerFile with full File objects.

Returns

User
User
The user’s public profile. When spaceReputation is requested, it carries an added spaceReputation number. See User data model and Reputation.