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

# Use Fetch Entity By Short Id

# `useFetchEntityByShortId`

## Overview

The `useFetchEntityByShortId` hook is used to retrieve details of a specific entity by providing its `shortId`.

## Usage Example

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

function EntityDetails({ shortId }: { shortId: string }) {
  const fetchEntityByShortId = useFetchEntityByShortId();

  const handleFetchEntity = async () => {
    try {
      const entity = await fetchEntityByShortId({
        shortId,
      });

      console.log("Fetched entity:", entity);
    } catch (error) {
      console.error("Failed to fetch entity:", error.message);
    }
  };

  return <button onClick={handleFetchEntity}>Fetch Entity Details</button>;
}
```

## Parameters & Returns

### Parameters

The hook returns a function that accepts an object with the following fields:

<ParamField path="shortId" type="string" required>
  The short identifier for the entity.
</ParamField>

### Returns

The function resolves with an object representing the fetched entity:

<ResponseField name="Entity" type="object">
  The details of the retrieved entity.
</ResponseField>
