Listen to window event in Plasmic page

Hey all!
qq… from within a plasmic page, can I listen to an event sent on the window and set a state variable or define the visibility of any element? is that built in or do I need to create a code component of some kind?

:point_up: anyone knows? :question:

I don’t know what events you’re trying to listen to, but typically they are available via Interactions.

Yeah I saw that, BUT this are custom events sent from a 3rd party widget we are embedding into the page.
I just created a CodeComponent listening to that and exposing data through DataProvider and registered with registerGlobalContext() cause I didn’t see any built-in way to accomplish this with custom events

Hi Sebastian, we currently don’t have any builtin way to handle 3rd party events

Hi @productive_duck, on your registered components (but not global contexts) you can add an interaction like onCustomEvent (a prop of type eventHandler), and in your code component code you can call that prop when your event happens, let me know if that works for you

Oh nice, didn’t see that … I’ve already resolved it the other way -which also makes it available for any component now- but I’ll have this in mind for future reference! thanks!!