Embed
When the studio is embedded on your website, it tells your page what happens inside it through postMessage, the browser standard that lets a page and an iframe talk. Each message is an object whose type starts with diamra:. Messages only travel between the studio and the page that frames it; on a direct visit to your store there is no page to talk to, so nothing is sent.
Your page's URL can also tell the studio where to start: with a product photo, or on a given view. See URL parameters.
In this part
- URL parametersAdd dmr_img_src to your page's URL to start the embedded Diamra studio from a product photo, or dmr_path to open it on a view such as the customer's projects.
- Listen for messagesAdd one postMessage listener next to the Diamra embed snippet, check the origin and the iframe, then test it on your live page from the browser console.
- Messages from the studioEvery message the embedded Diamra studio sends your page, such as diamra:ready and diamra:estimate.accepted, with the fields each one carries.
- Commands to the studioThe commands your page can post to the embedded Diamra studio: sign the customer out, open another view, or tell it your page's address.