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

# Stream Chat Integration

> Power your team's real-time messaging module with Stream Chat.

## Overview

Nextoria Hub's Communication module is built on [Stream Chat](https://getstream.io/chat/) — one of the highest-performance real-time messaging APIs available. Stream Chat handles message delivery, presence, push notifications, and scaling so Nextoria Hub can focus on the agency workflow layer on top.

## Prerequisites

* A [Stream](https://getstream.io) account
* Admin access on your Nextoria Hub workspace

## Setup

<Steps>
  <Step title="Create a Stream app">
    1. Log in to [getstream.io](https://getstream.io) and click **Create App**
    2. Name it after your agency workspace 3. Select your preferred region
       (closest to your team) 4. Note your **App ID**, **API Key**, and **API
       Secret**
  </Step>

  <Step title="Connect in Nextoria Hub">
    Go to **Settings → Integrations → Stream Chat** and enter: - **API Key**
    (public, used on the frontend) - **API Secret** (private, used server-side
    for token generation) - **App ID** Click **Connect and Test** to verify the
    keys are valid.
  </Step>

  <Step title="Configure channels">
    After connecting, Nextoria Hub will: - Automatically create `#general` and
    `#engineering` channels - Create linked channels for all existing projects -
    Provision chat users for all team members
  </Step>
</Steps>

## How Tokens Work

Stream Chat uses **server-side generated JWT tokens** to authenticate users. When a team member logs into Nextoria Hub:

1. The Nextoria Hub server generates a signed Stream JWT using the API Secret
2. The token is sent to the client and used to initialize the Stream Chat SDK
3. Tokens expire after 24 hours and are refreshed automatically on login

This means your Stream API Secret **never leaves the server** — it is not exposed in the client bundle.

## Push Notifications

To enable mobile push notifications via Stream Chat:

1. In the Stream Dashboard, go to **Messaging → Push Notifications**
2. Add your FCM (Android) or APNs (iOS) credentials
3. Toggle **Enable Push** in Nextoria Hub at **Settings → Integrations → Stream Chat → Push**

## Moderation

Nextoria Hub exposes Stream Chat's moderation features through the Admin panel:

* **Message flagging** — flagged messages are surfaced in the Admin moderation queue
* **User muting** — mute disruptive team members from specific channels
* **Channel archiving** — archive completed project channels (messages preserved, channel hidden)

## Rate Limits

Stream Chat's free tier includes 5 MAUs (Monthly Active Users) and 500,000 messages per month. These limits are more than sufficient for evaluation.

For production use:

| Stream Chat Plan | MAUs      | Price      |
| ---------------- | --------- | ---------- |
| Free             | 5         | \$0        |
| Startup          | 1,000     | \~\$99/mo  |
| Growth           | 10,000    | \~\$299/mo |
| Enterprise       | Unlimited | Custom     |

<Info>
  Your Stream Chat subscription is separate from your Nextoria Hub subscription.
  Contact the Stream sales team for volume pricing if you exceed the included
  limits.
</Info>
