Skip to main content

Overview

useFetchMutualSpaces returns a callable function that fetches the spaces both the authenticated user and another user are active members of — their spaces in common. The response is a paginated list of Space objects.

Usage Example

Parameters

string
required
The other user’s ID. Mutual spaces are computed between this user and the authenticated user.
number
Page number. Defaults to 1.
number
Number of results per page: a whole number from 1 to 100. Defaults to 20. A larger value is rejected with 400 space/invalid-query, never lowered to 100.
SpaceIncludeParam
Optional. A single value or an array; the only value is "files". Pass it to populate avatar and banner file objects on each space.

Returns

Space[]
The spaces both users share (Space). Computed fields such as membersCount and isMember reflect the authenticated user.
object
Standard pagination metadata.