Transfer value or message between Next Js and PlayCanvas

I want to create a next js project. I will design a ui in it
And I want an event to happen in playcanvas on every button that is clicked
I entered the playcanvas project directly into next without using iframe.
How can I communicate between next and playcanvas and how can I send a message or value from playcanvas to next?

Hey, use browser postMessage API to talk between Playcanvas app and your front-end app:

1 Like