cometchat-core

Standardize CometChat React UI Kit v6 initialization and login sequencing.

Updated May 28, 2026
One-click install
npx skills add https://github.com/MAX5271/CometChat --skill cometchat-core-max5271
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cometchat-core
Source: https://github.com/MAX5271/CometChat/tree/main/.claude/skills/cometchat-core
Command: npx skills add https://github.com/MAX5271/CometChat --skill cometchat-core-max5271

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents brittle or broken CometChat UI integrations by standardizing the one-time initialization, safe login sequencing, environment-variable setup, and SSR/client-only constraints needed for reliable React UI Kit v6 usage.

Core Features & Use Cases

  • One-time asynchronous initialization: ensures CometChatUIKit.init() completes before any UI components render, including React StrictMode-safe guards.
  • Safe login orchestration: avoids the “Please wait until the previous login request ends.” error by using sequential or in-flight promise reuse for concurrent calls.
  • Correct user identification: retrieves the current UID from the SDK (via login listener getters) instead of hardcoding dev UIDs.
  • CSS and theming via public variables: uses @cometchat/chat-uikit-react/css-variables.css once at the app root and applies --cometchat-* overrides safely.
  • Production vs development auth guidance: supports dev login(uid) and production loginWithAuthToken(token) patterns without exposing secrets.
  • SSR safety and provider pattern: enforces browser-only rendering and recommends gating UI with a provider that exposes ready/error state.

Quick Start

Read cometchat-core first, then implement a module-scoped CometChat initializer plus a provider that gates rendering until init and login complete.

Frequently Asked Questions about cometchat-core

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix the CometChat "Please wait until the previous login request ends" error in React?

Fix the CometChat previous login request error by using sequential or in-flight promise reuse for concurrent calls. This safe login orchestration prevents overlapping requests from breaking the React UI Kit v6 authentication flow.

Why does CometChat initialization break in React StrictMode?

CometChat initialization breaks in React StrictMode due to double-invoked effects causing repeated asynchronous setup. Enforcing strict init-before-render ordering with one-time asynchronous initialization guards ensures UIKit completes setup before UI components mount.

How do I safely render CometChat UI components in an SSR-capable React framework?

Safely render CometChat UI components in SSR frameworks by enforcing browser-only rendering and gating the chat UI with a provider that exposes ready and error states until client-side initialization and login complete.

What is the correct way to apply CSS variables and theming for the CometChat React UI Kit?

Correct CometChat React UI Kit theming requires importing the chat-uikit-react css-variables.css file once at the app root, then overriding the --cometchat-* public CSS variables safely to achieve the desired visual style.

Should I hardcode the UID for CometChat login in development?

Do not hardcode the UID for CometChat login; instead, retrieve the current UID from the SDK using login listener getters. For production, switch to the loginWithAuthToken(token) pattern to avoid exposing secrets.

Does CometChat React UI Kit v6 require UIKitSettingsBuilder configuration before rendering?

Yes, CometChat React UI Kit v6 requires UIKitSettingsBuilder configuration before rendering. Standardizing this setup ensures the one-time asynchronous initialization completes successfully before any chat UI components are mounted.