Skip to main content

Documentation Index

Fetch the complete documentation index at: https://cometchat-22654f5b-release-unreal-docs.mintlify.app/llms.txt

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

Create User

Before you log in a user, the user must exist in CometChat.
  1. For proof of concept / MVPs: Create users via the CometChat Dashboard.
  2. For production apps: Use the Create User REST API when your user signs up.
Sample UsersCometChat provides 5 pre-created users for testing: cometchat-uid-1, cometchat-uid-2, cometchat-uid-3, cometchat-uid-4, and cometchat-uid-5.

Login using Auth Key

This authentication method is ideal for proof-of-concept development or early-stage apps. For production environments, we recommend using an Auth Token instead of an Auth Key for enhanced security.

Auth Flow

  1. Get a reference to the CometChat Subsystem
  2. Call the Login Async node
  3. Wire the On Success and On Failure pins
ParameterTypeDescription
UidFStringThe unique ID of the user to log in
Auth KeyFStringYour CometChat Auth Key
UID format: UIDs can be alphanumeric with underscores and hyphens. Spaces, punctuation, and other special characters are not allowed.

Login using Auth Token

This is the recommended authentication method for production apps. Auth Tokens are generated server-side using the CometChat REST API and provide enhanced security since your Auth Key is never exposed on the client.

How Auth Tokens Work

  1. Your backend calls the Create Auth Token REST API with the user’s UID
  2. The API returns an Auth Token
  3. Your backend sends the token to the Unreal client
  4. The client calls LoginWithAuthTokenAsync with the token
  1. Get a reference to the CometChat Subsystem
  2. Call the Login With Auth Token Async node
  3. Wire the On Success and On Failure pins
ParameterTypeDescription
Auth TokenFStringThe auth token received from your backend
Security: Never hardcode Auth Tokens in your client. Always fetch them from your backend at runtime.

Check Login State

Before performing operations, you can check whether a user is currently logged in.
Call the Get Logged In User node on the CometChat Subsystem. It returns an FCometChatUser — if the Uid is empty, no user is logged in.

Logout

Logs the current user out and disconnects the real-time WebSocket.
Call the Logout Async node on the CometChat Subsystem. Wire the On Success and On Failure pins.

Shutdown

To fully tear down the SDK (e.g., when your game is closing), call Shutdown on the Subsystem. This releases all resources and closes connections.
Call the Shutdown node on the CometChat Subsystem.
You typically don’t need to call Shutdown manually — the Subsystem’s Deinitialize handles cleanup when the game instance is destroyed.

Next Steps

Overview

Return to the SDK overview and architecture.

Send a Message

Send your first text message after logging in.

Real-Time Events

Listen for incoming messages and presence updates.