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

# useSetNft

Hook to set the NFT of the current user in a stream. You should be validating if the NFT belongs to the user before setting it.

## Imports

```ts theme={null}
import { useSetNft } from '@towns-protocol/react-sdk'
```

## Definition

```ts theme={null}
function useSetNft(
  streamId: string,
  config?: ActionConfig<Myself["setNft"]>,
): {
    data: void | undefined;
    error: Error | undefined;
    isPending: boolean;
    isSuccess: boolean;
    isError: boolean;
    setNft: (nft: NftModel) => Promise<void>;
}
```

**Source:** [useSetNft](https://github.com/towns-protocol/towns/blob/main/packages/react-sdk/src/useMyMember.ts)

## Parameters

### streamId

* **Type:** `string`

The id of the stream to set the NFT of.

### config

* **Type:** `ActionConfig<Myself["setNft"]>`
* **Optional**

Configuration options for the action.

## Return Type

The `setNft` action and its loading state.

```ts theme={null}
{
    data: void | undefined;
    error: Error | undefined;
    isPending: boolean;
    isSuccess: boolean;
    isError: boolean;
    setNft: (nft: NftModel) => Promise<void>;
}
```
