Skip to content

Understanding the Embed Process

Amit Shuster edited this page Jan 24, 2021 · 6 revisions
ℹ️ This wiki has been deprecated
All our Client APIs documentation and references can be found in the new Power BI embedded analytics Client APIs documentation set.

What actually happens when you call powerbi.embed(element, embedConfig);?

The Embed Process

  1. Determine if we are embedding an element that contains embedded content.

    If the content already embedded is of the same type, we can re-use the existing iframe and simply send a new load command to it rather than reloading the entire contents of the iframe. Reload is much slower because there is a significant amount of JavaScript to download.

  2. (New Embed) Create instance of embed object. (Existing Embed) Skip this step.

    1. The constructor of the embed will normalize all the required configuration from either the HTML attributes or those passed directly in the configuration object.
  3. The elements content is replaced with an <iframe> whose src attribute is set to the embed url from the embed configuration.

  4. A load event listener is added to the iframe element.

  5. When the iframe loads the HTML page it calls embed.load, which is the next step.

  6. Call embed.load, which takes the normalized load configuration that sends the loadConfiguration object (a subset of the embedConfiguration) to the iframe via window.postMessage.

  7. Send window.postMessage