A client needs an external react.js page embedded in account records but it needs to interact with the account page. For example, the react.js page needs to display data from related records of the account record that it is embedded in. Firstly, can this be done? If so, what would be the recommended way to embed the page in an account (lightning component? lightning web page that is a wrapper to the react.js page?) and can it communicate with the account related list records?

  • At a high level, this seems like a painful choice for means of integration. I suggest you pursue an approach where all your UI elements are native to Salesforce, and you pull in any data you need from the external system via other means.
    – Adrian Larson
    Oct 25, 2022 at 13:01
  • I accept what you said but we need the same page to be accessible on an external website and the IT team knows react.js well. They want to use the same page inside the SF account so an internal employee sees the same data and there is only one GUI interface and if changes need to be made, it's in one place. Can you think of any other way to doing this correctly?
    – Apex N-u-b
    Oct 25, 2022 at 13:15
  • Just to give a full picture, each account has a child object called subscriptions. The client wants to allow their customers to login to their external site, and view their subscriptions and made changes or whatever and if an internal employee needs to do this for the customer, they employee can go into the account, view this react.js page and make the changes for the customer themselves. Does this make sense?
    – Apex N-u-b
    Oct 25, 2022 at 13:18
  • You're going to have to explore message listeners and postMessage. You might hit security roadblocks you can't work around, so I would be leery of saying it will work for sure, but you at least can specify targetOrigin.
    – Adrian Larson
    Oct 25, 2022 at 13:57

1 Answer 1


The only tool you really have here architecturally is to use window messaging. Both components will need to add message listeners. Once you've done that, you should be able to postMessage between them to communicate. I wouldn't say it's the "best practice" here (which would be to avoid framing in external pages), but it might work for you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .