Skip to main content
User Profiles covers fetching and searching for other users’ public profiles. This is distinct from Current User, which covers the authenticated user’s own data. All hooks in this section return User objects — the public-facing profile type. Unlike AuthUser, User omits private fields such as email, secureMetadata, isVerified, isActive, and lastActive.

Hooks

useFetchUser

Fetch a user’s public profile by their Replyke user ID.

useFetchUserByForeignId

Fetch a user’s public profile by their foreign ID (from your own system).

useFetchUserByUsername

Fetch a user’s public profile by their username.

useFetchUserSuggestions

Search for users by a query string. Useful for autocomplete and user lookup.

useCheckUsernameAvailability

Check whether a username is available before setting it.

useUserMentions

Full mention flow: detects @ triggers, fetches suggestions, inserts the username into content, and tracks mentioned users.

The include Parameter

Several hooks accept an optional include parameter. Passing "files" (or ["files"]) instructs the server to populate the user’s avatarFile and bannerFile fields with full File objects instead of returning only the IDs.
const user = await fetchUser({ userId, include: "files" });
// user.avatarFile is now populated

User vs AuthUser

FieldUser (public)AuthUser (self only)
id, name, username, avatar, bio
email
secureMetadata
authMethods
suspensions
isVerified, isActive, lastActive
See the User data model for the complete field reference.