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
  • Properties
  • Type Definition
  • Example
  1. Guides
  2. Player Communication
  3. Message API Reference

Visitor — Pass User Context

PreviousStickers — Voucher ClaimNextShared Legacy Message Properties

Last updated 3 months ago

The Pass User Context message enables the host app / environment to pass visitor information to the LiSA Player.

This message requires waiting for the AppListening message to ensure the LiSA Player is ready to receive messages from the host app / environment. Please ensure the host app sends messages only after receiving this message.

This message is sent by the host app / environment to the LiSA Player.

Properties

Along with all standard , a Pass User Context message includes the following additional properties:

Name
Type
Description

avatarUrl

Optional.

The avatarUrl property is used to provide a URL pointing to an image that represents the visitor's avatar.

Ensure the image URL points to a properly hosted and publicly accessible resource to avoid display issues.

displayName

Optional.

The displayName property is used to specify the current visitor's display name, which will be shown in comments.

id

Required.

The id property is used to define the current visitor's unique identifier within the user management system of the host app or environment. This identifier will be associated with the visitor's session in LiSA.

isCommentsConsentRequired

Optional.

This property indicates whether the visitor is required to consent to the comments policy before being allowed to post comments. Default value: true

messageType

Required.

lsc:visitor:pass-user-context

Legacy Properties

If your integration uses LiSA Player Version 1, none of the properties described above — except id — will be available.

For LiSA Player Version 2, legacy properties can be ignored.

Name
Type
Description

action

Required.

avatar

Optional.

The avatar property is used to provide a URL pointing to an image that represents the visitor's avatar.

consent

Optional.

editable

Optional.

name

Optional.

target

Required.


Type Definition

interface VisitorUserContextMessage extends Omit<
  Message,
  'messageType' | 'recipient'
> {
  avatarUrl?: string;
  displayName?: string;
  id: string;
  isCommentsConsentRequired?: boolean;
  recipient: 'LiSA';
  messageType: 'lsc:visitor:pass-user-context';

  // Legacy LiSA Player V1 attributes for backwards compatibility. 

  action: 'join';
  avatar?: string;
  consent?: boolean;
  editable?: boolean;
  name?: string;
  target: 'user';
}

Example

window.postMessage({
  avatarUrl: 'https://my-cdn.com/path/to/image.jpg',
  displayName: 'Jane Doe',
  id: '65cf573a-8c51-4b89-b2da-3d79b35fcf1b',
  isCommentsConsentRequired: false,
  recipient: 'LiSA',
  sender: 'Sender',
  messageType: 'lsc:visitor:pass-user-context',

  // Legacy properties - Can be omitted when integrating Player V2
  action: 'join',
  avatar: 'https://my-cdn.com/path/to/image.jpg',
  consent: true,
  editable: false,
  name: 'Jane Doe',
  target: 'user',
});

join Please use messageType instead.

Ensure the image URL points to a properly hosted and publicly accessible resource to avoid display issues. Please use avatarUrl instead.

This property indicates whether the visitor is required to consent to the comments policy before being allowed to post comments. Default value: true Please use isCommentsConsentRequired instead.

This property indicates whether the visitor can edit their username in the comments. Default value: true This property is no longer supported in Player Version 2.

The name property is used to specify the current visitor's display name, which will be shown in comments. Please use displayName instead.

user Please use messageType instead.

String
String
String
Boolean
Literal
Literal
String
Boolean
Boolean
String
Literal
⚠️
⚠️
⚠️
⚠️
⚠️
⚠️
Message properties