<aside> 🧩

Optional. Lets your page react to events raised inside the embedded game.

</aside>

The Splash iframe posts events to the parent window via window.postMessage. Listen for them on the client side and act accordingly — for example, removing the iframe when the user clicks the in-game close button.

<script>
function receiveMessage(event) {
  if (event.data.type === 'close') {
    console.log("Close button was clicked in iframe!");
    // remove the splash iframe
  }
}

window.addEventListener("message", receiveMessage, false);
</script>

Event types

type Raised when…
close The user clicks the in-game close button.
terms-conditions The user opens Terms & Conditions.
game-rules The user opens Game Rules.
faq The user opens the FAQ.
login The user clicks the login button.
signup The user clicks the signup button.