Overview
useFetchUserSuggestions returns a function that searches for users by a query string. This is the underlying hook used by useUserMentions for @mention autocomplete, but it can also be used for any user search or autocomplete UI.
This hook uses an authenticated request. The user must be signed in.
Usage Example
Parameters
The hook returns a function. That function accepts:string
required
The search string. Matched against usernames and names.
string
Optional. Resolves each suggested user’s reputation into a
spaceReputation number. Accepts a space <uuid> or "none" (project-general bucket) only — "context" is rejected with a 400 on this endpoint. Empty string, "general", and null are also rejected. See Reputation.boolean
Optional. When
true, spaceReputation is the subtree sum (the space plus all its descendants). Only honored when spaceReputationId is an explicit <uuid>.Returns
array
An array of matching users’ public profiles. When
spaceReputationId is set, each carries an added spaceReputation number. See User data model and Reputation.
