Newer Version Available

This content describes an older version of this product. View Latest

Communicating Across the DOM with Lightning Message Service (Beta)

Use Lightning message service to communicate across the DOM, between Aura components, Visualforce pages, and Lightning web components. If you're switching from Salesforce Classic to Lightning Experience, you can now build Lightning web components that can communicate with existing Visualforce pages or Aura components. Lightning message service is available in Lightning Experience only.

As a beta feature, Lightning Message Service is a preview and isn’t part of the “Services” under your master subscription agreement with Salesforce. Use this feature at your sole discretion, and make your purchase decisions only on the basis of generally available products and features. Salesforce doesn’t guarantee general availability of this feature within any particular time frame or at all, and we can discontinue it at any time. Lightning Message Service is for evaluation purposes only, not for production use. It’s offered as is and isn’t supported, and Salesforce has no liability for any harm or damage arising out of or in connection with it. All restrictions, Salesforce reservation of rights, obligations concerning the Services, and terms for related Non-Salesforce Applications and Content apply equally to your use of this feature. You can provide feedback and suggestions for Lightning Message Service in the Trailblazer Community.

Note

To access Lightning message service in Aura, use the lightning:messageChannel component. A message is a serializable JSON object. Examples of data that you can pass in a message include strings, numbers, booleans, and objects. A message cannot contain functions and symbols. The lightning:messageChannel component is only available in Lightning Experience.