feat: widget opened and closed events (#11240)

Fixes #9272

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
This commit is contained in:
David Kubeš
2025-04-24 13:31:39 +02:00
committed by GitHub
parent 73f768e0bf
commit ecc95478b9
4 changed files with 40 additions and 13 deletions

View File

@@ -22,7 +22,11 @@ import {
} from './bubbleHelpers';
import { isWidgetColorLighter } from 'shared/helpers/colorHelper';
import { dispatchWindowEvent } from 'shared/helpers/CustomEventHelper';
import { CHATWOOT_ERROR, CHATWOOT_READY } from '../widget/constants/sdkEvents';
import {
CHATWOOT_ERROR,
CHATWOOT_POSTBACK,
CHATWOOT_READY,
} from '../widget/constants/sdkEvents';
import { SET_USER_ERROR } from '../widget/constants/errorTypes';
import { getUserCookieName, setCookieWithDomain } from './cookieHelpers';
import {
@@ -205,7 +209,7 @@ export const IFrameHelper = {
postback(data) {
dispatchWindowEvent({
eventName: 'chatwoot:postback',
eventName: CHATWOOT_POSTBACK,
data,
});
},