For AI agents: Find a documentation index at https://talkjs.com/llms.txt (full content at https://talkjs.com/llms-full.txt). Get a markdown version of any page by appending .md to its URL path.

Group chat

Build group chats for small teams and large communities.

View as Markdown

You can use TalkJS for anything from a private chat between three teammates to a live event with thousands of fans.

Inbox with a conversation list. A group chat is selected, and shows messages and reactions from 3 participants

Group chat with team collaboration

Group chats are great for use cases such as:

  • Team chats inside a company-wide collaboration tool
  • Live video streaming events with real-time discussion
  • A general lobby or reception room for an online event

For private messaging between two users, see 1-on-1 chat.

Participants and guests

A user in a group chat can either be a participant or a guest:

  • Participant: A user who is a member of a conversation. Participants can read messages, send messages, and perform message actions. Among other things, participants can also be @mentioned and appear in the conversation's participant list.
  • Guest: A user who isn't a member of a conversation, but instead has lightweight guest access to that conversation. Guests can read all messages, send messages, and perform message actions in a conversation. Among other things, guests can't be @mentioned and won't appear in the conversation's participant list.

Participants and guests have access to the following features:

FeatureParticipantGuest
Send and receive messages✓✓
Send files, voice messages, location✓✓
React with emojis✓✓
See when people are typing✓✓
Others see when they type✓
Can be @mentioned✓Only after sending a message
Unread messages tracked✓
Desktop notifications✓✓
Email/SMS notifications✓
Appears in participant list✓
Inbox UI✓
Chatbox UI✓✓
Popup UI✓✓
Conversation appears in inbox✓
Webhooks✓All except notification and message-read events

To use some of the features in this table, you need to enable them for a user's role.

Whether a user is a participant or a guest is specific to a group chat. A user can be a participant in one conversation, and a guest in another conversation.

When to use participants or guests

Participant and guest access are each great for different types of situations. For example:

Access typeGreat for
Participants

Private group chats with known members, such as:

  • Buyer/Seller chat
  • Group chats between friends
  • Workplace discussions
Guests

Larger, open chat rooms, such as:

  • Livestream chat
  • Server-wide game chat
  • Comment sections
Combination of participants and guests

Larger chats where some but not all users need to be a listed, notifiable participant

Maximum number of users in group chats

Per conversationBasicGrowthEnterprise
Participants (Counts all members added to the conversation, including offline users.)100300Custom (e.g. 10,000+)
Concurrent guests (Counts guests who have the conversation open at the same time, separate from the participant limit. There is no limit on how many guests can join over time.)3001,250Custom (e.g. 10,000+)

For example, on the Growth plan, a single conversation can have up to 300 participants and up to 1,250 concurrent guests, with no limit on the number of unique users who joined as guests over the course of a livestream.

If a conversation reaches its participant limit, adding another participant returns an error until you remove an existing one. If the guest limit is full, the next guest sees a message asking them to try again later. There is no limit on the number of group chats you can create.

Add an AI assistant or bot to a group chat

An AI assistant joins a group chat the way a person does: it's a TalkJS user that you add to the conversation as a participant. You bring the model, and your server connects it to the chat:

  1. Create a user for the assistant, with the name and photo people should see.
  2. Add it to the group chat as a participant. It can read the messages sent before it joined.
  3. Listen for the message.sent webhook. Each event has a mentionedUserIds list, so the assistant can stay quiet until someone @mentions it, instead of answering every message in the group.
  4. Send the reply with the assistant's user ID as the sender, so it appears under the assistant's own name.

Add the assistant as a participant, not a guest. A guest can only be @mentioned after it has sent a message, as the table above shows.

For the full setup, see AI agent and chatbot integration. To let people ask several assistants questions in one group chat, see Multiple AI agents.

Access permissions

In addition to being a participant or guest, users can have different access permissions that determine what they can do in a conversation.

Guests always have full read-write access to a conversation. You can give participants the following access permissions:

Access typeValueDescription
Full read-writeReadWriteThe participant can read and write messages in the conversation.
Read-onlyReadThe participant can read but not write messages in the conversation.

To revoke both read and write access, remove the participant. If you add them again later, they'll be able to read the entire conversation history, including all the messages sent while they didn't have access.

If you're building with the Classic React SDK or JavaScript SDK, check out the Control access permissions guide on how to update participants' access.