Skip to main content
This section documents the Angular services provided by the CometChat UIKit. These are injectable services you use via Angular’s dependency injection to manage state, configure components, and customize behavior.

Core Classes

CometChatUIKit

The main entry point for initializing and configuring the UIKit.
The UIKit exposes two session-check methods with intentionally different casing — this mirrors the underlying CometChat SDK naming.
  • getLoggedInUser() (capital I, synchronous) — returns the in-memory cached user immediately. Use this for quick checks inside components where you already know the user is logged in.
  • getLoggedinUser() (lowercase i, async) — makes an SDK call to verify the session. Use this in ngOnInit or main.ts before rendering components, as it is the authoritative check.
The casing difference is not a typo — it is intentional to match the SDK’s own API surface.

UIKitSettings

Build settings using UIKitSettingsBuilder:

UIKitSettingsBuilder Methods

setCallingEnabled(true) requires @cometchat/calls-sdk-javascript to be installed. Without the Calls SDK package, calling features will not activate even when enabled.

Services

Documented Services

Service Scoping (Multiple Instances)

Most customization services (MessageBubbleConfigService, FormatterConfigService, CometChatTemplatesService, RichTextEditorService) are provided at the root level as singletons. This means all component instances share the same configuration by default. If you need different configurations for different component instances (e.g., a main chat panel and a thread panel with different bubble styles), you can scope a service to a wrapper component by adding it to the component’s providers array. Angular’s hierarchical dependency injection will give that component and its children their own service instance.
See the State Management Guide — Scoping Customization Services and CometChatMessageList — Multiple Message Lists for complete examples.
Do not scope ChatStateService — it is intentionally a singleton that tracks the app-wide active conversation. Use the props-based pattern ([user], [group]) for independent panels instead.

CometChatMessageEvents

Subscribe to message-related events.

CometChatUserEvents

Subscribe to user-related events.
See the full Events reference for all available event names.

Type Definitions

All types are exported from the main package: