Skip to main content

Documentation Index

Fetch the complete documentation index at: https://cometchat-22654f5b-docs-android-v6-beta2.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

# Install (pubspec.yaml)
cometchat_sdk: ^4.0.33
import 'package:cometchat_sdk/cometchat_sdk.dart';

// 1. Initialize (once at app startup)
AppSettings appSettings = (AppSettingsBuilder()
  ..subscriptionType = CometChatSubscriptionType.allUsers
  ..region = "APP_REGION" // e.g. "us", "eu", "in"
  ..autoEstablishSocketConnection = true
).build();

CometChat.init("APP_ID", appSettings,
  onSuccess: (msg) => debugPrint("Init success"),
  onError: (e) => debugPrint("Init failed: ${e.message}"),
);

// 2. Login (check session first)
CometChat.getLoggedInUser(
  onSuccess: (user) {
    if (user == null) {
      CometChat.login("cometchat-uid-1", "AUTH_KEY", // dev only — use Auth Token in production
        onSuccess: (user) => debugPrint("Login success"),
        onError: (e) => debugPrint("Login failed"),
      );
    }
  },
  onError: (e) => debugPrint("Error: ${e.message}"),
);
Credentials: App ID, Region, Auth Key from CometChat Dashboard Test UIDs: cometchat-uid-1 through cometchat-uid-5
The CometChat Flutter SDK lets you add real-time messaging, voice, and video calling to any Flutter application — iOS, Android, Web, or Desktop.

Requirements

RequirementMinimum Version
Flutter SDK1.2
Android API Level21
iOS11
Requires AndroidX compatibility. For iOS platform setup, see Setup.

Getting Started

1

Get your credentials

Sign up for CometChat and create an app. Note your App ID, Region, and Auth Key from the Dashboard.
2

Install and initialize

Add the SDK to your project and initialize it with your credentials. See Setup.
3

Authenticate users

Log in users with Auth Key (development) or Auth Token (production). See Authentication.
4

Start building

Send your first message, make a call, or manage users and groups.

Features

Messaging

1:1 and group chat, threads, reactions, typing indicators, read receipts, file sharing, and interactive messages.

Voice & Video Calling

Ringing flows, direct call sessions, standalone calling, recording, and screen sharing.

Users

Create, retrieve, and manage users. Track online/offline presence and block/unblock users.

Groups

Public, private, and password-protected groups with member management, roles, and ownership transfer.

Sample Apps

Explore working examples with full source code:

Flutter Chat App

Flutter sample app

UI Kits

Skip the UI work — use pre-built, customizable components:

Flutter UI Kit

Flutter UI Kit

Resources

Key Concepts

UIDs, GUIDs, auth tokens, and core SDK concepts

Message Structure

Message categories, types, and hierarchy

Changelog

Latest SDK version and release notes

Upgrading from V3

Migration guide for V3 users

Troubleshooting

Common issues and solutions

Next Steps

Setup

Install and initialize the CometChat Flutter SDK

Authentication

Log in users with Auth Key or Auth Token

Send Messages

Send your first text, media, or custom message

Key Concepts

UIDs, GUIDs, auth tokens, and core SDK concepts