Skip to main content

Overview

Returns state and a match function for ranking users by activity-derived interest facets. In passive mode it matches against the current user’s own facets (“who is like me?”); in directed mode it matches against a free-text topic (“who is into biotech?”). For setup and the underlying model, see the Interest Matching guide.

Usage Example

Parameters

Call match with:
'passive' | 'directed'
required
"passive" matches against the current user’s facets; "directed" matches against query.
string
The free-text topic to match against. Required in directed mode; must be non-empty (a blank directed query is a no-op). TypeScript refuses it in passive mode.
number
Maximum number of matched users (max 50).
string
Restrict candidates to users active in this space. Without includeChildSpaces, a space the current user can’t read (see Who can read content), or one that doesn’t exist, matches nobody: results is empty, with no error.
boolean
With spaceId, also include users active in the space’s subtree, counting only the spaces in it the current user can read. A sub-space they can read counts even when they can’t read the named space itself; activity in a space they can’t read never counts.
boolean
Request illustrative sample content per matched facet (only honored when the project has exposeSampleContent enabled).
boolean
Exclude the current user from results. Defaults to true server-side.

Returns

UserMatchResult[]
Ranked matches (descending by score).
boolean
true while a match is in progress.
SublayError | null
The error if the last match failed. A SublayError.
(props) => Promise<void>
Executes the match and updates results.
() => void
Clears results and error.