Skip to main content

What is a Plugin?

A plugin owns one or more message types. It tells the UI Kit:
  • How to render the message as a bubble in the message list
  • What context menu options to show when a user hovers/long-presses a message
  • What preview text to display in the Conversations list subtitle
Every message that appears in the UI is rendered by a plugin. If no plugin matches a message type, the message is not displayed.

Where Plugins Are Used


Default Plugins

These plugins are included automatically — no configuration needed:

How Plugin Resolution Works

When the UI Kit needs to render a message, it asks the Plugin Registry to find the right plugin:
  1. If the message is deleted (getDeletedAt() !== null), the Delete plugin handles it
  2. Otherwise, the registry finds the first plugin whose messageTypes includes the message’s type AND whose messageCategories includes the message’s category
  3. First match wins — plugin order matters

Adding Plugins

Default plugins are always included. To add extra plugins (like AI), pass them via the plugins prop on CometChatProvider:
Your custom plugins are appended after the defaults. Since first match wins, default plugins take priority for their message types. To override a default plugin, you’d need to use the manual approach with a custom plugin array.

Creating a Custom Plugin

Implement the CometChatMessagePlugin interface. Here’s a minimal “location” message plugin:
Register it:
For a complete tutorial with sending, receiving, and styling, see Creating a Custom Plugin.

Plugin Interface Reference

Plugin Context

The context object passed to every plugin method:

Next Steps

Text Plugin

Text rendering, mentions, markdown, URLs

Image Plugin

Image grid, captions, fullscreen viewer

Custom Plugin

Build your own plugin from scratch

Text Formatters

URL, mentions, markdown, and custom formatters