LiSA Social Commerce
Developers
Developers
  • Developers
  • Guides
    • Integration Guide
      • Web Integration
      • App Integration
        • Android
          • Communication
          • Storage
          • File Downloads
          • Theming
        • iOS
          • Communication
          • Storage
          • File Downloads
          • Theming
        • React Native
          • Communication
          • Storage
          • File Downloads
          • Theming
        • Picture in Picture
      • Entrypoints
        • Query Parameter (v1)
    • Player Communication
      • Message API Reference
        • App
          • App — Heartbeat
          • App — Message Acknowledge
          • App — Message Error
          • App — Listen
        • CTA
          • CTA — Link in Comments
          • CTA — Sponsor Badge
        • Cart — View Cart
        • Comments — Join
        • Media
          • Media — Complete
          • Media — Pause
          • Media — Progress
          • Media — Resume
        • Media Item
          • Media Item — Emoji
          • Media Item — Impression
        • Player
          • Player — Dismiss
          • Player — Native Picture-in-Picture (PiP)
          • Player — Pass Visual Viewport
          • Player — Request Visual Viewport
          • Player — UI Transition
        • Products
          • Products — Add to Cart
          • Products — Add to Wishlist
          • Products — Click
          • Products — Close Product List
          • Products — Emoji
          • Products — Emoji State Update
          • Products — Impression
          • Products — Open Product List
        • Stickers
          • Stickers — Activate
          • Stickers — Click
          • Stickers — Expire
          • Stickers — Impression
          • Stickers — Publish
          • Stickers — Unlock
          • Stickers — Unpublish
          • Stickers — Update
          • Stickers — Voucher Claim
        • Visitor — Pass User Context
        • Shared Legacy Message Properties
    • Products
      • Product Update Notification API
  • Widgets
    • Content Hub
    • Quick Start Guide
    • Appearance
      • Markup
      • Responsive design
    • Configuration options
      • Autoplay
      • Channel
      • Client
      • Data
      • Debug
      • Host node
      • Layout
      • Language
      • On
      • Player
      • Query string
      • Quick view
      • Sections
      • Store
      • Template
    • API reference
      • Library API reference
      • Player API reference
      • Quick View API reference
    • Customisations
      • Template
      • Bring your own template
      • Type definitions
    • Examples
    • Type definitions
      • Asset
      • Product
      • Other
    • Promo Widget
      • Quick Start Guide
      • Configuration options
        • Autoplay
        • Channel
        • Countdown (deprecated)
        • Enabled
        • Image modifier
        • Lead time
        • Live (deprecated)
        • Position
        • Replay (deprecated)
        • Show ID
        • URL
  • Media Player Introduction
    • Picture-in-Picture Mode
  • Analytics
  • REST API
    • Authentication
    • Rate limits
    • Response status and error codes
    • API Documentation
Powered by GitBook
On this page
  • Basic Embedding
  • Communication Between LiSA Player and the Web Environment
  1. Guides
  2. Integration Guide

Web Integration

This guide explains how to embed the Player in a web environment using an <iframe>. It also covers communication between the parent page and the iframe.

Basic Embedding

To embed the Player, use the following basic <iframe> setup:

<iframe
  src="https://{clientId}.loveslisa.tech/s/{showId}"
  width="100%"
  height="100%"
  style="border: none;"
  allow="autoplay; clipboard-write"
/>

Communication Between LiSA Player and the Web Environment

To enable bi-directional communication between the parent page and the iframe, use the postMessage API.

Sending Messages to the LiSA Player

The parent page can send messages to the iframe using the contentWindow.postMessage method:

javascriptCopyEditconst iframe = document.querySelector('iframe');

const message = {
  recipient: 'LiSA',
  sender: 'Me',
};

iframe.contentWindow.postMessage(message, 'https://{clientId}.loveslisa.tech/s/{showId}');

Receiving Messages from the LiSA Player

Listen for messages sent from the LiSA Player on the parent page:

javascriptCopyEditwindow.addEventListener('message', (event) => {
  // Verify the message origin for security
  if (event.origin !== 'https://{clientId}.loveslisa.tech') {
    return;
  }

  console.log(event.data);
});
PreviousIntegration GuideNextApp Integration

Last updated 3 months ago