Commands to the studio
Your page can post these to the studio's iframe, with your store's address as the target origin.
diamra:sign_out
Signs the customer out, such as on a shared counter tablet once the sale is closed. The studio answers with diamra:customer.signed_out.
diamra:navigate
Moves the studio to another view.
diamra:hello
Tells the studio your page's address when a strict referrer policy hides it. Without that address the studio holds its messages back, diamra:ready included. Send it once your page has loaded and every second until diamra:ready arrives. A normal https page never needs it.
Send a command
const STUDIO_ORIGIN = "https://yourstore.diamra.com";
const studio = () => document.querySelector("[data-diamra-store] iframe");
studio().contentWindow.postMessage({ type: "diamra:navigate", path: "/salon/projects" }, STUDIO_ORIGIN);