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.