> ## Documentation Index
> Fetch the complete documentation index at: https://replyke-feat-push-rich-payload-fields.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# useAddHost

> Grant a user host privileges on an event (host-only)

## Overview

`useAddHost` returns a callable that adds a user to an event's `hostIds`. **Host-only** — the logged-in user must already be a host. The operation is idempotent.

## Usage Example

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

function AddCoHost({ eventId }: { eventId: string }) {
  const addHost = useAddHost();
  return (
    <button onClick={() => addHost({ eventId, userId: "usr_cohost" })}>
      Add co-host
    </button>
  );
}
```

## Parameters

<ParamField path="eventId" type="string" required>The event ID.</ParamField>
<ParamField path="userId" type="string" required>The user to grant host on the event.</ParamField>

## Returns

Returns a `Promise<Event>` — the [Event](/data-models/event) with the new `hostIds`.

## See Also

* [Add Host API](/api-reference/events/add-host)
* [useRemoveHost](/hooks/events/use-remove-host)
