> ## Documentation Index
> Fetch the complete documentation index at: https://docs.replyke.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch space by slug

> Fetch a single space by its URL slug

## Overview

`useFetchSpaceBySlug` returns a callable function that fetches a space using its `slug`. Slugs are optional, unique per project, and must match the pattern `^[\p{L}\p{N}]+(?:[-_][\p{L}\p{N}]+)*$` (letters, numbers, hyphens, underscores, supports Unicode).

## Usage Example

```tsx theme={null}
import { useFetchSpaceBySlug } from "@replyke/react-js";

function SpacePage({ slug }: { slug: string }) {
  const fetchSpace = useFetchSpaceBySlug();

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

## Parameters

<ParamField path="slug" type="string" required>
  The URL slug of the space.
</ParamField>

<ParamField path="include" type="&#x22;files&#x22; | string[]">
  Optional. Pass `"files"` to include avatar and banner file objects.
</ParamField>

## Returns

Returns a [SpaceDetailed](/data-models/space) object.

For most use cases, prefer [`SpaceProvider slug`](/sdk/spaces/provider-and-hook) prop over calling this hook directly.
