Initializing the Design Lab
The Design Lab can be initialized by calling the DesignLab.default
function (see previous section). This function takes an object as a parameter with the following properties:
Config
Parameter | Required | Type | Example | Description |
---|---|---|---|---|
apiKey | Yes |
| - | Design Lab API Key generated for your account |
product | Yes | product: { id: 23, color: "Red", name: "Custom name", description: "Custom Description"} | Information on the product to be loaded in the Design Lab. | |
externalCustomerId | Yes |
| customer-12 | A string identifier unique to each of your customers. If you don't need to identify your customers, just send an identifier for yourself and make sure it is always the same |
logoURL | No |
| safsira-logo | URL for a custom logo to be shown on the Design Lab. If no |
userSelectedQuantity | No |
| 100 | A quantity to be used as the initial value in the Design Lab quantity field. If the product has a Minimum Order Quantity (MOQ) greater than this number, the MOQ will be used instead. Also if no |
renderHeader | No |
|
| Boolean value to determine if the Design Lab header should be rendered or not. If |
renderFooter | No |
|
| Boolean value to determine if the Design Lab footer should be rendered or not. If |
header | No |
| Data to be displayed on the Design Lab header (mainly the title and breadcrumbs). For this information to be rendered, | |
startingStep | No |
|
| Number to determine the starting step of the Design Lab. If not provided, the default starting step will be the first step (1) |
notifications | No |
| Data to be displayed on the Design Lab notifications. If not provided, the default notifications will be used. See the Notifications type for more information | |
onClose | No |
| -- | Callback function to be executed when closing the Design Lab using the cross on the top right corner |
onFinish | No |
| -- | Callback function to be executed when user finishes designing a product. Will receive newly created Custom Product data from our API as a parameter |
Product (product Type)
Parameter | Required | Type | Example | Description |
---|---|---|---|---|
id | Yes |
| 9053 | Product id of the product to load in the Design Lab |
color | No |
| "Red" | Valid color variant name to load for the product in the Design Lab. If not provided, the default color variant will be loaded instead |
name | No |
| "custom product name" | Custom name to be displayed for the product in the Design Lab. If not provided, the product name will be used instead |
description | No |
| "custom product description" | Custom description to be displayed for the product in the Design Lab. If not provided, the product description will be used instead |
Header (header Type)
Parameter | Required | Type | Example | Description |
---|---|---|---|---|
title | No |
| "Design Lab" | Title to be displayed at the top of the Design Lab. If no |
breadcrumbs | No |
| List of elements that define the breadcrumbs |
BreadCrumbEntry (Type)
Parameter | Required | Type | Example | Description |
---|---|---|---|---|
name | Yes |
| "Catalog" | Text to be displayed on the breadcrumb item. |
href | No |
|
| Used as a href to render the breadcrumb as a link |
Notifications (notifications Type)
Parameter | Required | Type | Example | Description |
---|---|---|---|---|
position | No |
| "bottom-left" | Position of the notifications on the Design Lab screen. If not provided,
the default position will be |
artworkCreated | No |
|
| Data to be displayed in the notification toast when an artwork is created. If not provided, the default message will be used |
artworkUpdated | No |
|
| Data to be displayed in the notification toast when an artwork is updated. If not provided, the default message will be used |
artworkDeleted | No |
|
| Data to be displayed in the notification toast when an artwork is deleted. If not provided, the default message will be used |
newArtworkVersionCreated | No |
|
| Data to be displayed in the notification toast when a new artwork version is created from a previous version. If not provided, the default message will be used |
error | No |
|
| Data to be displayed in the notification toast when an error occurs. If not provided, the default message will be used |