Skip to main content

Overview

useFetchSpaceByShortId returns a callable function that fetches a space using its shortId. The shortId is a compact, URL-safe identifier generated automatically when a space is created.

Usage Example

import { useFetchSpaceByShortId } from "@replyke/react-js";

function SpacePage({ shortId }: { shortId: string }) {
  const fetchSpace = useFetchSpaceByShortId();

  const handleFetch = async () => {
    const space = await fetchSpace({ shortId });
    console.log(space.name);
  };
}

Parameters

shortId
string
required
The short identifier of the space.
include
"files" | string[]
Optional. Pass "files" to include avatar and banner file objects.

Returns

Returns a SpaceDetailed object. For most use cases, prefer SpaceProvider shortId prop over calling this hook directly.