feat: open help center article from sdk

Add window.$chatwoot.openArticle(slug) which opens the widget and navigates the in-widget article viewer to the given help center article.
This commit is contained in:
Shivam Mishra
2026-06-02 16:01:09 +05:30
parent 16e638aeb7
commit 8625a00918
2 changed files with 30 additions and 0 deletions
+9
View File
@@ -109,6 +109,15 @@ const runSDK = ({ baseUrl, websiteToken }) => {
});
},
openArticle(slug) {
if (!slug) {
throw new Error('Article slug is required');
}
IFrameHelper.events.toggleBubble('open');
IFrameHelper.sendMessage('open-article', { slug });
},
setUser(identifier, user) {
if (typeof identifier !== 'string' && typeof identifier !== 'number') {
throw new Error('Identifier should be a string or a number');