Skip to content

Commit 476c3cc

Browse files
committed
fix(core): expose plugin APIs through singleton
- Add getter properties for modal, inline, banner on singleton - Allows script tag users to access window.experiences.modal.show() - Fixes playground getting stuck at 'Loading Experience SDK...' Now window.experiences.modal, .inline, .banner are available
1 parent 6d279cf commit 476c3cc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/core/src/singleton.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,16 @@ export const experiences = {
188188
getState,
189189
on,
190190
destroy,
191+
// Expose plugin APIs from the default instance
192+
get modal() {
193+
return (defaultInstance as any).modal;
194+
},
195+
get inline() {
196+
return (defaultInstance as any).inline;
197+
},
198+
get banner() {
199+
return (defaultInstance as any).banner;
200+
},
191201
};
192202

193203
/**

0 commit comments

Comments
 (0)