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

> ## Agent Instructions
> Treat these docs and the Whop MCP server as the source of truth for Whop API behavior. Don't infer endpoint behavior from marketing pages.
> MCP server: connect https://mcp.whop.com/mcp (streamable HTTP, browser sign-in, no API key in the client config) to search these docs and read or change live Whop data. Setup: https://docs.whop.com/developer/guides/ai_and_mcp.md
> Whop CLI: install with `curl -fsSL https://whop.com/install.sh | sh` to scaffold, run, and deploy Whop apps and websites. It acts on production, not the sandbox. Overview: https://docs.whop.com/cli/overview.md Agent mode: https://docs.whop.com/cli/agent-mode.md
> Hosting: Whop serves a site or app from the build `whop apps deploy` uploads, with rollbacks, secrets, and server logs. Guide: https://docs.whop.com/developer/websites/hosting.md
> Plugins: in Claude Code, run `/plugin marketplace add whopio/plugins`, then `/plugin install whop@whop`. Guide: https://docs.whop.com/developer/guides/plugins/claude-code.md Every agent tool: https://docs.whop.com/developer/ai/overview.md
> Environments: build and test in the sandbox (API `https://sandbox-api.whop.com/api/v1`, keys at https://sandbox.whop.com/dashboard/developer, SDK environment `Sandbox`; no real money). Production (API `https://api.whop.com/api/v1`, keys at https://whop.com/dashboard/developer, SDK environment `Production`, the SDK default) moves real money, so use it only at launch. The two share no accounts, keys, products, or webhooks, and their keys look identical: never mix them. Sandbox guide: https://docs.whop.com/developer/guides/sandbox.md Comparison: https://docs.whop.com/developer/quickstart.md
> API: send `Authorization: Bearer <API_KEY>` from your server only, and pin a dated version with the `Api-Version-Date` header. OpenAPI spec: https://api.whop.com/api/v1/openapi.json
> Which API: build on the Current API, whose pages live under https://docs.whop.com/api-reference/ (start at https://docs.whop.com/api-reference/overview.md). Pages under /api-reference/legacy/ are the Legacy API. Use one only when https://docs.whop.com/api-reference/stability.md lists the resource as Legacy-only.

# Sohbet

> Kanal listesi ve mesaj aramasıyla gerçek zamanlı sohbet.

> [!NOTE]
>
> Bu sayfa `@whop/elements@1.10.0` ve `@whop/elements-react@1.10.0` sürümlerini belgeler.

*`v1.10.0` sürümünden beri.*

```tsx React theme={null}
import { WhopElements, Chat } from "@whop/elements-react";
import { loadWhop } from "@whop/elements";

function Example() {
  return (
    <WhopElements elements={loadWhop()}>
      <Chat /* options */>
        {/* mount elements here */}
      </Chat>
    </WhopElements>
  );
}
```

```html JavaScript theme={null}
<script src="https://cdn.whop.com/elements/amber/elements.js" data-whop-elements></script>
<script type="module">
  const chat = window.WhopElements().chat.create({ /* options */ });
</script>
```

## Seçenekler

Bunları `whop.chat.create({ … })` fonksiyonuna veya React'te `<Chat>` üzerinde props olarak iletin.

**accessToken** `string`

Kapsamlı bir kullanıcı token'ı. Sunucunuzda `POST /api/v1/access_tokens` ile bir tane oluşturun ve süresi dolmadan önce `update({ accessToken })` ile yenisini ayarlayın. Kanallar `chat:read` ve `chat:message:create` kapsamlarını, doğrudan mesajlar `dms:read`, `dms:message:manage` ve `dms:channel:manage` kapsamlarını, destek sohbetleri ise `support_chat:read` ve `support_chat:message:create` kapsamlarını gerektirir.

**accountId** `string`

Sohbetin sınırlandırılacağı, `biz_` önekli hesap kimliği.

**channelId** `string | null`

`feed_` veya `chat_feed_` önekli etkin kanal kimliği.

**defaultChannelId** `string | null`

`feed_` veya `chat_feed_` önekli başlangıç etkin kanal kimliği.

**style** `"imessage" | "discord"`

Sohbetin stili. Varsayılan: `"imessage"`.

**appearance** `Appearance`

Bu grubun öğeleri için görsel özelleştirme. Genel `WhopElements({ appearance })` ayarını geçersiz kılar. `update({ appearance })` ile canlı olarak değiştirin.

**locale** `WhopElementsLocale`

Bu grubun öğe arayüz metinleri için yerel ayar. Genel yapılandırmayı geçersiz kılmak için uygulamanın derlenmiş yerel ayarlarından birine ayarlayın. Diğer tüm değerler varsayılan yerel ayara geri döner.

## Olaylar

Geri çağırmaları create seçeneklerinde veya React props'larında iletin.

### `onChannelChange`

Etkin kanal değiştiğinde yayılır. Kanal odaklanmış bir mesajla açıldığında `focusMessageId` içerir.

**payload** `object`

**properties**

**channelId** `string` *required*

**focusMessageId** `string`

### `onLoadingChange`

Gruplanmış yükleme durumu değiştiğinde çalışır. Bağlı herhangi bir öğe hâlâ yükleniyorken değer `true` olur.

**loading** `boolean`

## Yöntemler

Bunları `whop.chat.create({ … })` veya `useChat()` ile alınan Chat tanıtıcısı üzerinde çağırın.

### `update`

Yeni tanıtıcı seçeneklerini bağlı her öğeyle birleştirir. React'te bunun yerine ad alanı props'larını değiştirin.

**Parametreler**

**options** `Partial\<ChatOptions\>` *required*

### `destroy`

Bu tanıtıcının oluşturduğu her öğeyi ve alt denetleyiciyi yok eder, denetleyici çerçevesini kaldırır ve aboneliklerini serbest bırakır. Birden fazla kez çağırabilirsiniz, ancak yok edilmiş bir tanıtıcı diğer tüm çağrıları reddeder; baştan başlamak için yeni bir tanıtıcı oluşturun. Sağlayıcı bağlantısı kaldırıldığında React grubu otomatik olarak kaldırır.

## Öğeler

Bu grubun bağladığı öğeler. Her birinin kendi sayfası vardır:

> [card] [ChatElement](https://docs.whop.com/tr/elements/latest/chat/chat.md)
>
> Gerçek zamanlı bir mesaj görünümü.

> [card] [ChannelListElement](https://docs.whop.com/tr/elements/latest/chat/channelList.md)
>
> Kullanıcının kanallarının listesi.

> [card] [SearchElement](https://docs.whop.com/tr/elements/latest/chat/search.md)
>
> Kullanıcının kanallarında mesaj aramak için bir modal.


## Related topics

- [Gömülü Sohbet Kanalları](https://docs.whop.com/tr/developer/guides/chat/channels.md)
- [Sohbet OAuth](https://docs.whop.com/tr/developer/guides/chat/oauth.md)
- [Sohbet Hızlı Başlangıcı](https://docs.whop.com/tr/developer/guides/chat/quickstart.md)
