Skip to main content
Follow these steps to integrate CometChat UIKit into your Angular application.

Prerequisites

  • Node.js 20.19+, 22.12+ or 24+ (what Angular 21 requires)
  • Angular 17, 18, 19, 20 or 21 — the UI Kit declares @angular/core >=17.0.0 <22.0.0
  • A CometChat account with App ID and Auth Key
Angular 22 is not supported yet: installing the UI Kit into an Angular 22 app fails with ERESOLVE. The latest Angular CLI scaffolds Angular 22, so create new apps with a pinned CLI: npx @angular/cli@21 new my-app --style css --ssr false.

Step 1: Install the Package

@cometchat/chat-sdk-javascript, @cometchat/cards-angular and dompurify are required peer dependencies — install them explicitly as shown.

Step 2: Import Styles

Add the CSS variables to your angular.json:
Or import in your global styles.css:
Use the relative node_modules path. The package’s exports map doesn’t expose ./styles, so @import '@cometchat/chat-uikit-angular/styles/css-variables.css' fails with Could not resolve.

Step 3: Register UIKit Assets

The UIKit ships icons, images, and audio files that Angular’s build system won’t serve automatically. Append the UIKit entry to the existing assets array in your angular.json (under architect.build.options) so they are copied to the output:
Keep the entries the CLI generated (public on Angular 18+; src/favicon.ico and src/assets on Angular 17) — replacing the array instead of appending to it stops your own static files from being served.
Skipping this step will cause all UIKit icons, empty-state images, and notification sounds to fail with 404 errors.
ng build fails with bundle initial exceeded maximum budget under the CLI’s default 1 MB production budget. Raise the initial budget in angular.json — see Raise the Production Bundle Budget.

Step 4: Initialize CometChat

Initialize CometChat in main.ts before bootstrapping the Angular app, using UIKitSettingsBuilder:
To enable voice and video calling, install @cometchat/calls-sdk-javascript and add .setCallingEnabled(true) to the builder. Without this, call buttons are hidden across all components. See Call Features for details.

Step 5: Login a User

Step 6: Add a Component

Add the conversations component to your template:
Make sure to replace YOUR_APP_ID, YOUR_AUTH_KEY, and YOUR_REGION with your actual CometChat credentials.

Next Steps

Integration Guide

Full setup guide with examples

Components

Explore all available components