Skip to main content
The UI Kit Builder simplifies integrating CometChat’s UI Kit into your Angular application — quickly set up chat, customize UI elements, and add features without extensive coding.

Complete Integration Workflow

  1. Design Your Chat Experience - Use the UI Kit Builder to customize layouts, features, and styling.
  2. Review and Export - Review which features will be enabled in your Dashboard, toggle them on/off, and download the generated code package.
  3. Preview Customizations - Optionally, run the export on its own before integrating it into your project.
  4. Integration - Integrate into your existing application.
  5. Customize Further - Explore advanced customization options to tailor the chat experience.

Launch the UI Kit Builder

  1. Log in to your CometChat Dashboard.
  2. Select your application from the list.
  3. Navigate to Chat & Messaging → Get Started.
  4. Choose Angular and click Launch UI Kit Builder.

Review Your Export

When you click Export, a “Review Your Export” modal appears (Step 1 of 3). This lets you:
  • Review features — See which features will be enabled in your CometChat Dashboard based on your UI Kit configuration
  • Toggle features — Turn individual features on/off before export
  • AI User Copilot — Requires an OpenAI API key (you’ll configure this in the next step)
Only checked features will be enabled in your Dashboard. You can always modify these settings later in the CometChat Dashboard.

Requirements


Preview Customizations (Optional)

The export is a complete, standalone Angular application. You can run it before integrating anything — this step is optional and can be skipped if you want to go straight to integration.
  1. Unzip the export (cometchat-builder-angular.zip) into a new folder and open it. The archive is packed flat — package.json and src/ are at the top level.
  2. Install dependencies:
  1. Run the app:
The app starts on http://localhost:4200. Sign in with one of the sample users on the login screen, or enter a UID from your own app. Your app credentials are already prepopulated in the exported code.
Use npm ci rather than npm install. The export ships a package-lock.json, and npm ci installs exactly the dependency tree the app was built and type-checked against.

Integrate into Your Project

If you already have an Angular application, you do not need the export’s shell — only the chat. The whole experience is one standalone component, <cometchat-app />.

Step 1: Install Dependencies

These match the versions pinned in the export’s package.json.

Step 2: Copy the App Code

Copy these from the export into your project, keeping the paths:
If your app already has an environment.ts, add the appId, region and authKey keys to it instead of replacing it. config/credentials.ts imports it from src/environments/environment, so keep that path or update the import.

Step 3: Register the Styles and Assets

In your angular.json, add the UI Kit’s CSS variables ahead of your own stylesheet, and copy both asset folders:
Without the second asset entry the chat renders but every icon is missing.
The copied components also rely on a few global layout rules. Angular host elements are inline by default, so without them the UI Kit components don’t stretch to fill their panels. Copy these blocks from the export’s src/styles.css into your global stylesheet:
  • UIKit Host Element Layout Fixes — the display: flex / flex: 1 rules for cometchat-selector, cometchat-tabs, cometchat-messages, cometchat-threaded-messages, cometchat-message-list, cometchat-message-composer and the other host elements
  • Thread panel — the .cometchat-threaded-messages background override
  • Skip Navigation Link — the .cometchat-skip-link rules, if you keep the skip link
The html, body and focus-ring rules in the same file are the standalone app’s own page styles. Your app likely has its own, so they’re optional.

Step 4: Apply Your Builder Settings at Startup

In your app.config.ts:
app.config.ts
Both injections are required. SettingsService applies the feature toggles and ThemeStylesService applies the appearance settings. If you omit the second, the app still runs, but the Builder’s brand color, text colors, theme and typography are silently ignored. This is synchronous — the settings are bundled rather than fetched, so there is no window in which the first screen renders against defaults.
Angular 18: provideAppInitializer was added in Angular 19. On 18, use the APP_INITIALIZER token with the same two injections:

Step 5: Initialize CometChat and Log In

The UI Kit needs two calls before the component renders. In your main.ts:
main.ts
Chain the promises rather than using top-level await. Top-level await does not build in an app that uses zone.js, which is the default for existing Angular 18–20 apps. It fails with Top-level await is not available in the configured target environment. The export’s own src/main.ts chains them the same way.
Your app credentials (appId, region, authKey) are prepopulated in the export’s src/environments/environment.ts, which you copied in Step 2. If you need different credentials, you can find them in the Credentials block of your app’s Overview section on the CometChat Dashboard.
CometChat uses a UID (User ID) to identify each user. You can either:
  1. Create new users on the CometChat Dashboard, via a UI Kit method, or via the API.
  2. Use pre-generated test users: cometchat-uid-1 through cometchat-uid-5
To avoid logging in a user who is already signed in, replace the login step in the chain above with a check:
main.ts
Auth Key vs Auth TokenAuth Key is perfect for prototyping. For production apps, switch to Auth Token for secure authentication and call CometChatUIKit.loginWithAuthToken(authToken) instead of CometChatUIKit.login(uid). See Authentication and User Management for details.

Step 6: Render the Component

Give it a container with a definite height. The component fills what it is given; in a container with height: auto it collapses to nothing.
Import it like any other standalone component:
src/app/app.component.ts

Open Straight Into a Conversation

Three optional inputs let you choose what the chat opens on:
Rebinding them switches conversation without remounting, so a host can move the chat between conversations by changing the bound value.
When both user and group are bound, the Builder’s chatType setting decides which one wins.

Without Sidebar Mode

When the sidebar is hidden via the Without Sidebar option in UI Kit Builder, the component renders a single chat type based on the chatType setting: Pass the user or group input to specify which conversation opens by default.

Step 7: Run the App


Troubleshooting

For issues with the UI Kit itself, see Angular UI Kit Troubleshooting.

Next Steps

You can continue customizing by editing the exported code directly — or return to the UI Kit Builder to adjust your configuration and re-export a fresh code package.

Customize in Code

Modify the exported components, inputs, and styling directly in your project.

Customizations

Adjust component inputs, behavior, and UI elements.

UI Kit Builder Settings

Understand the settings file and feature toggles.

Directory Structure

See how the exported code is organized.

Advanced Theming

Customize colors, typography, and styling to match your brand.

Customize via UI Kit Builder

Return to the Builder to update your configuration, then re-export and replace the code package. Any changes made in the UI Kit Builder will require you to re-export the code and follow the same integration steps above to integrate into your project.

Launch UI Kit Builder

Open the CometChat Dashboard to reconfigure and re-export.