Overview
useUpdateSpace returns a callable function for updating a space. Only space admins can update a space. Supports updating avatar and banner images.
When using SpaceProvider, prefer calling updateSpace from useSpace — it handles state updates automatically.
Usage Example
import { useUpdateSpace } from "@replyke/react-js";
function SpaceSettings({ spaceId }: { spaceId: string }) {
const updateSpace = useUpdateSpace();
const handleSave = async (name: string, description: string) => {
const updated = await updateSpace({
spaceId,
update: { name, description },
});
console.log("Updated:", updated.name);
};
}
Parameters
UUID of the space to update.
Fields to update. All fields are optional.
New display name (3–100 characters).
New URL slug. Pass null to remove.
New description. Pass null to remove.
Updated reading permission.
postingPermission
"anyone" | "members" | "admins"
Updated posting permission.
Updated join approval requirement.
avatar
{ file: File | Blob; options: UploadImageOptions }
New avatar image to upload.
banner
{ file: File | Blob; options: UploadImageOptions }
New banner image to upload.
Returns
Returns the updated SpaceDetailed object.