Receiving events
When a user saves a design, Designa posts a message to your page so you can capture the result.
Listen for saved designs
javascript
window.addEventListener("message", (event) => {
if (event.origin !== "https://app.designa.ai") return;
if (event.data?.type !== "DESIGNA_ASSET_CREATED") return;
const { imageUrl, designId } = event.data.payload;
// store imageUrl; pass &designId=<id> on the next embed URL to re-edit it
});Always check event.origin first
Any page can send your window amessage event. Reject anything that isn't from https://app.designa.ai before touching event.data.Event reference
| Field | Type | Description |
|---|---|---|
event.data.type | string | Always "DESIGNA_ASSET_CREATED" for a save event. |
event.data.payload.imageUrl | string | Public URL of the generated/exported asset. |
event.data.payload.designId | string | Stable id for this design — pass it back as &designId= on a later embed URL to reopen and update it instead of creating a new one. |
What to do with it
Most integrations store imageUrl against whatever record the user was designing for (a product, a campaign, a listing) and keep designId alongside it so the user can jump back into Designa later to make edits without starting over.