Table of Content

    Event Listener

    • July 23, 2025
    • 1 mins read

    Table of Content

      You can add an event listener to listen for custom events triggered by the REVE Chat iframe. This allows you to handle specific actions or messages sent from the chat widget to your website.

      Use the following example to listen for a custom event from the REVE Chat iframe and handle the data.

      Example

      // Define a handler function for the custom event
      function handleCustomMessage(event) {
        if (event.type === 'customRevechatMessage') {
          const message = event.data;
          console.log("Received message from iframe: " + message);
        }
      }
      
      // Add the event listener
      document.addEventListener('customRevechatMessage', handleCustomMessage);

      Any questions? Please email us at [email protected]

      AUTHOR’S BIO

      Mohaimin Talha is a seasoned Product Manager, known for his ability to combine creativity with analytical thinking. His strategic vision and customer-centric approach make him a key driver of product success and business growth.

      0:00 / 0:00