# Enable and configure Chat (/en/realtime-media/im/get-started/enable)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

Before using Chat, you need to enable and configure it through [Agora Console](https://console.agora.io/v2).

## Prerequisites [#prerequisites]

To enable Chat, make sure that you have the following:

* A valid [Agora account](/en/realtime-media/im/get-started/manage-agora-account#create-an-agora-account).
* An [Agora project](/en/realtime-media/im/get-started/manage-agora-account#create-an-agora-project) that uses  **App ID** and **Token** for authentication.
* A Chat pricing plan. For details on how to subscribe, see [Subscribe to the pricing plan](/en/realtime-media/im/reference/pricing#subscribe-to-the-pricing-plan).

## Enable Chat [#enable-chat]

1. Log in to the [Agora Console](https://console.agora.io/v2).

2. In the left navigation bar, click **Project Management** and click **Config** for the project that you want to use.

3. In the **Features** section of the **Edit Project** page, click **Enable** next to **Chat** to enable Chat.

   If this is your first Chat project, select and subscribe to a Chat package:

   ![](https://assets-docs.agora.io/images/im/subscribe.png)

4. Select a data center closest to where most of your end users are located.

   ![img](https://web-cdn.agora.io/docs-files/1665386519450)

   Once Chat is enabled, you are redirected to the Chat config page.

5. Enable the advanced Chat features based on your business requirements.

   ![](https://assets-docs.agora.io/images/im/chat_feature_overview.png)

For details about these advanced features, see the following:

* [Message Callback](/en/realtime-media/im/build/notifications-and-event-handling/setup-webhooks)
* [Message Recall](/en/realtime-media/im/build/build-core-messaging/messages/send-receive-messages#recall-a-message)
* [Message Thread](/en/realtime-media/im/build/build-groups-rooms-and-threads/threading/thread-management)
* [Reaction](/en/realtime-media/im/build/build-core-messaging/reaction)
* [Offline Message Push (Advanced)](/en/realtime-media/im/build/notifications-and-event-handling/offline-push/overview)
* [Presence](/en/realtime-media/im/build/build-core-messaging/presence)
* [Translation](/en/realtime-media/im/build/build-core-messaging/messages/translate-messages)
* [Moderation](/en/realtime-media/im/build/moderate-and-manage-client-behavior/moderation-mechanism)

## Get Chat project information [#get-chat-project-information]

Agora Console assigns the following information to each project that enables Chat:

* **Data Center**: Agora provides several data centers for the service in different regions, including Singapore, Frankfurt (Germany), and Virginia (USA). After the plan is changed, the data center remains unchanged.
* **AppKey**: The unique identifier that Chat assigns to each app. The **AppKey** is of the form `${OrgName}#{AppName}`.
  <CalloutContainer type="info">
    <CalloutDescription>
      The **AppKey** is not the same as your project App ID. You can get your **AppKey** from the Chat configuration section of Agora Console.
    </CalloutDescription>
  </CalloutContainer>
* **OrgName**: The unique identifier that Chat assigns to each enterprise (organization).
* **AppName**: The name that Chat assigns to each app. Each app under the same enterprise (organization) must have a unique App Name.
* **API request url**: The domain of the WebSocket and RESTful API request that Agora assigns to each project.

Follow these steps to get the project information:

1. Find your Chat-enabled project on the [Project Management](https://console.agora.io/v2/project-management) page on Agora Console and click **Config**.
2. On the project edit page, find **Chat** and click **Config**.
3. On the Chat config page, get the values of **Data Center**, **AppKey**, **OrgName**, **AppName**, **WebSocket Address**, and **REST API**.

## Manage users and generate tokens [#manage-users-and-generate-tokens]

For development purposes, Agora enables you to manage users and generate Chat user authentication tokens using Agora Console. In a production environment, you use the [RESTful API](/en/api-reference/api-ref/im/user-system-registration) to manage users and a token server to [generate user authentication tokens](/en/realtime-media/im/build/secure-access-and-authentication/authentication).

This section shows you how to register Chat users and generate temporary tokens using Agora Console.

### Register a user [#register-a-user]

To register a user, do the following:

1. On the **Project Management** page, click **Config** for the project that you want to use.

   ![](https://web-cdn.agora.io/docs-files/1664531061644)

2. On the **Edit Project** page, click **Config** next to **Chat** below **Features**.

   ![](https://web-cdn.agora.io/docs-files/1664531091562)

3. In the left-navigation pane, select **Operation Management** > **User** and click **Create User**.

   ![](https://web-cdn.agora.io/docs-files/1664531141100)

4. In the **Create User** dialog box, fill in the **User ID**, **Nickname**, and **Password**, and click **Save** to create a user.

   ![](https://web-cdn.agora.io/docs-files/1664531162872)

### Generate an app token [#generate-an-app-token]

In the **Data Center** section of the **Application Information** page, click **Generate** next to **Chat App Temp Token** to generate a token with app privileges.

```
![token_generate_app_token](https://assets-docs.agora.io/images/im/token_generate_app_token.png)
```

### Generate a user token [#generate-a-user-token]

To ensure communication security, Agora recommends using tokens to authenticate users who log in to Chat.

For testing purposes, Agora Console supports generating temporary tokens for Chat. To generate a user token, do the following:

1. On the **Project Management** page, click **Config** for the project that you want to use.

   ![](https://web-cdn.agora.io/docs-files/1664531061644)

2. On the **Edit Project** page, click **Config** next to **Chat** below **Features**.

   ![](https://web-cdn.agora.io/docs-files/1664531091562)

3. In the **Data Center** section of the **Application Information** page, enter the [user ID](#userid) in the **Chat User Temp Token** box and click **Generate** to generate a token with user privileges.

   ![](https://web-cdn.agora.io/docs-files/1664531214169)

## Change the Chat plan [#change-the-chat-plan]

1. Log in to the [Agora Console](https://console.agora.io/v2).

2. In the left navigation bar, click **Package**.

3. On the **Subscribe** tab, you can change your Chat plan by clicking **Subscribe** next to the desired plan.

   ![img](https://web-cdn.agora.io/docs-files/1665389469534)

   **Note:**

   * The plan change takes effect immediately.
   * Agora doesn't recommend plan downgrading, as it could impact the capacity of your applications and availability of certain features.

## Disable Chat [#disable-chat]

1. Log in to the [Agora Console](https://console.agora.io/v2).

2. In the left navigation bar, click **Project Management** and click **Config** for the project that you want to use.

3. In the **Features** section of the **Edit Project** page, click **Enable/Configure** next to **Chat**.

4. On the **Application Information** page, disable Chat in the **Chat Service Status** section.

   **Note:** When you disable Chat, the Chat-related data is still stored in the Chat data center, and you are still charged for the plan activation fee.

   ![img](https://web-cdn.agora.io/docs-files/1665387330975)

## Unsubscribe Chat [#unsubscribe-chat]

Before unsubscribing Chat, disable all projects that have Chat enabled.

1. Log in to the [Agora Console](https://console.agora.io/v2).

2. In the left navigation bar, click **Package**.

3. On the **Subscribe** tab, scroll down to the bottom and click **Unsubscribe**.

   ![img](https://web-cdn.agora.io/docs-files/1665389814916)

   **Note:**

   When you unsubscribe Chat:

   * All Chat-related data is purged.
   * You are still billed with a pro-rated monthly fee and the usage that occurred during that month.

## Next steps [#next-steps]

After enabling and configuring Chat, the Chat-related features in Agora Analytics are enabled by default to help you keep track of usage trends and quality details. For more information, see [Data Insights](/en/realtime-media/im/reference/console/data-insights) and [Data Metrics](/en/realtime-media/im/reference/console/data-metrics).
