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
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:- If the message is deleted (
getDeletedAt() !== null), the Delete plugin handles it - Otherwise, the registry finds the first plugin whose
messageTypesincludes the message’s type AND whosemessageCategoriesincludes the message’s category - First match wins — plugin order matters
Adding Plugins
Default plugins are always included. To add extra plugins (like AI), pass them via theplugins prop on CometChatProvider:
Creating a Custom Plugin
Implement theCometChatMessagePlugin interface. Here’s a minimal “location” message plugin:
Plugin Interface Reference
Plugin Context
Thecontext 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