The KitMaker iFrame allows you to embed a fully functional design creation tool directly into your own web application via an iFrame.
To integrate the editor, embed the following URL in an <iframe> element on your page:
<iframe
id="kitmaker-editor"
src="https://www.kitmaker.eu/public/design/external-editor"
width="100%"
height="1000px"
frameborder="0"
></iframe>Once the iFrame is loaded, you must initialize it by sending a postMessage event. This message authenticates the session and provides the initial data (style, logos).
Send a message with the type INIT_EXTERNAL_DESIGNER:
const iframe = document.getElementById("kitmaker-editor");
const message = {
type: "INIT_EXTERNAL_DESIGNER",
apiKey: "YOUR_API_KEY", // Required
payload: {
// Initial Design Data
styleId: 31930,
title: "My Custom Design",
designLogos: [
{
view: "FRONT",
logoId: 514686,
xCoordinate: 422.23,
yCoordinate: 422.33,
angleRads: 1.57
}
],
organizationId: 123
},
config: {
/* See Configuration page */
}
};
iframe.contentWindow.postMessage(message, "*");payload Object
| Parameter | Type | Required | Description |
|---|---|---|---|
| styleId | integer | Yes | The ID of the product style (garment) to design on. |
| title | string | Yes | The initial title for the design. |
| designLogos | array | Yes | An array of logos to place initially. |
| organizationId | integer | Optional | The ID of the organization to create the design for. Defaults to the authenticated vendor's organization. |
designLogos Object
If either of xCoordinate or yCoordinate is not included in the JSON payload they will default to 0. If both xCoordinate and yCoordinate are missing the iFrame will default to a centered placement.
| Parameter | Type | Required | Description |
|---|---|---|---|
| view | string | Yes | The view name (e.g., "FRONT", "BACK") where the logo should be placed. |
| logoId | integer | Yes | The ID of the logo to place. |
| xCoordinate | string | Optional | The initial X position of the logo. |
| yCoordinate | string | Optional | The initial Y position of the logo. |
| angleRads | string | Optional | Rotation angle in radians. Defaults to 0. |