Overview
useCreateSpace returns a callable function for creating a new space. The request can include avatar and banner image uploads. The creator is automatically added as an admin.
Usage Example
Parameters
Optional URL slug. Must be unique per project. Supports letters, numbers, hyphens, and underscores (Unicode allowed).
Optional avatar image to upload. The
options object controls format, quality, dimensions, and variants.Who may read content, for your app to enforce. Defaults to
"anyone". The v7 API reports it in memberPermissions.canRead but doesn’t hide the content inside the space; see Content inside a space and the v8 rules.Who may post entities, for your app to enforce. Defaults to
"members". The v7 API reports it in memberPermissions.canPost but doesn’t refuse entities that don’t match it; see Content inside a space and the v8 rules.Who can find and see the space. Defaults to
"public". Independent of readingPermission. "unlisted" hides the space from discovery and search but keeps it reachable by direct link; "private" hides the space, and the spaces under it, from everyone except its active members — it answers 404 like a nonexistent space and can’t be joined. The content inside it stays readable in v7; see Content inside a space and the v8 rules. See Space visibility.The space’s own NSFW flag. Defaults to
false. If the space is created under an NSFW parent, its effective NSFW status is true regardless of this value (a live rollup — see Space NSFW flagging). Sublay labels and filters NSFW content; it does not blur or age-gate it.Returns
Returns the created Space object.When creating a child space, all admins and moderators of the parent space are automatically added to the new child space with their same roles.

