This page contains JavaScript SDK code examples for Customer Support extensions. For feature documentation, setup instructions, and extension settings, see Customer Support Extensions.
How to Use Extensions with SDK
Enable in Dashboard
Login to CometChat Dashboard, select your app, then go to Chat & Messaging → Features and enable the extension. Configure integration
Add your Chatwoot or Intercom credentials and configure the Customer Support user UID in the extension settings.
Send messages
Messages sent to the configured Customer Support user are automatically forwarded to your support platform.
Chatwoot
The Chatwoot extension makes customer support seamless for your users. Messages sent to the configured Customer Support user are automatically forwarded to your Chatwoot inbox.
The Chatwoot integration is configured through the CometChat Dashboard and works automatically once set up. No additional SDK code is required beyond standard messaging.
Sending a Support Message
Simply send a message to the Customer Support user configured in your extension settings:
const textMessage = new CometChat.TextMessage(
"customer-support-uid", // The UID configured in extension settings
"I need help with my order",
CometChat.RECEIVER_TYPE.USER
);
CometChat.sendMessage(textMessage).then(
message => {
// Support message sent successfully
// Message will be forwarded to Chatwoot automatically
console.log("Message sent successfully:", message);
},
error => {
console.log("Error sending message:", error);
}
);
Intercom
The Intercom extension makes customer support seamless for your users. Messages sent to the configured Customer Support user are automatically forwarded to your Intercom dashboard.
The Intercom integration is configured through the CometChat Dashboard and works automatically once set up. No additional SDK code is required beyond standard messaging.
Sending a Support Message
Simply send a message to the Customer Support user configured in your extension settings:
const textMessage = new CometChat.TextMessage(
"customer-support-uid", // The UID configured in extension settings
"I have a question about billing",
CometChat.RECEIVER_TYPE.USER
);
CometChat.sendMessage(textMessage).then(
message => {
// Support message sent successfully
// Message will be forwarded to Intercom automatically
console.log("Message sent successfully:", message);
},
error => {
console.log("Error sending message:", error);
}
);