Interface: Actions
Provides methods for manipulating the configurator state and controlling product configurations.
The Actions interface gives you direct control over the product configurator, allowing you to programmatically change options, control the camera, manage the scene, export content, and perform various operations that would normally require user interaction.
Example
// Select a product option
const option = { /* option data */ };
window.mimeeqApp.actions.markOption(option, 'block123', 'colorPicker');
// Zoom out to see the entire product
window.mimeeqApp.actions.zoomOut();
AugmentedReality
generateAR
generateAR:
GenerateAR
Function
Creates an Augmented Reality (AR) version of the current product configuration.
This action processes the current product with all its customizations and generates an AR-ready model that can be viewed on compatible devices. It returns a unique shortcode that can be used to access the AR experience.
Business value:
- Allows customers to visualize products in their actual environment before purchase
- Reduces returns by setting accurate expectations of product size and appearance
- Creates engaging marketing experiences that drive conversion
- Provides sales teams with powerful visualization tools for client meetings
Example
// Add a "View in your space" AR button to your product page
document.getElementById('view-in-ar').addEventListener('click', () => {
window.mimeeqApp.actions.generateAR().then(shortcode => {
if (shortcode) {
window.location.href = `/ar-viewer?code=${shortcode}`;
}
});
});
getARShortCodeData
getARShortCodeData:
GetARShortCodeData
Function
Retrieves detailed information about an AR model from its shortcode.
This action looks up an existing AR model using its unique identifier and returns comprehensive information about the model, including file paths, product details, and conversion status. For models still being processed, it can provide a subscription to notify when processing completes.
Business value:
- Supports seamless AR experiences by accessing previously created AR models
- Enables informative loading states when AR models are still processing
- Provides product details for consistent AR experience labeling
- Allows tracking of AR model status for analytics and troubleshooting
Example
// Load AR viewer with proper model information
const arShortcode = getParameterFromUrl('code');
if (arShortcode) {
window.mimeeqApp.actions.getARShortCodeData(arShortcode, true)
.then(arData => {
if (arData) {
if (arData.glbPath && arData.usdzPath) {
// Models are ready, load AR viewer
initializeARViewer(arData);
} else if (arData.completeSubscription) {
// Models are processing, wait for completion
showLoadingIndicator();
arData.completeSubscription.then(result => {
hideLoadingIndicator();
initializeARViewer({...arData, ...result});
});
}
} else {
showErrorMessage("AR model not found");
}
});
}
Param
Unique identifier for the AR model
Param
Whether to include a completion notification for processing models
regenerateAR
regenerateAR:
RegenerateAR
Function
Attempts to recreate an AR model when initial generation fails.
This action tries again to create an AR-compatible version of a product when the first attempt was unsuccessful. It uses existing AR data to ensure consistency and returns a shortcode for accessing the AR experience if successful.
Business value:
- Improves AR reliability by providing automatic recovery from generation failures
- Enhances customer experience by reducing error messages during AR experiences
- Maximizes AR availability for products with complex configurations
- Supports continuous operation of AR features in busy retail environments
Example
// Implement automatic retry when AR generation fails
window.mimeeqApp.actions.generateAR().then(shortcode => {
if (!shortcode && arData) {
// First attempt failed, try again
return window.mimeeqApp.actions.regenerateAR(arData);
}
return shortcode;
}).then(finalShortcode => {
if (finalShortcode) {
window.location.href = `/ar-viewer?code=${finalShortcode}`;
} else {
showErrorMessage("AR currently unavailable for this product");
}
});
Param
Previously generated AR data containing model information
showAR
showAR:
ShowAR
Function
Opens the Augmented Reality (AR) viewing interface.
This method initiates the AR experience for the current product configuration. On desktop devices, it displays a modal with a QR code that mobile users can scan to view the product in AR. On mobile devices, it directly launches the AR viewer.
AR viewing allows customers to visualize products in their actual physical space, providing a powerful tool for evaluating size, fit, and appearance in context.
Example
// Add a custom AR button to your interface
document.getElementById('custom-ar-btn').addEventListener('click', () => {
window.mimeeqApp.actions.showAR();
});
Fires
Mimeeq-internal-show-ar
Authentication
havePermissions
havePermissions:
HavePermissions
Function
Checks if the current user has specific permissions.
This method verifies whether the logged-in user has any of the specified permissions, which control access to various features and actions in the system. It's useful for conditionally showing or enabling functionality based on user permissions.
Permission-based UI adaptation ensures users only see and access features they're authorized to use, providing a cleaner and more secure experience.
Example
// Only show the export button if the user has export permissions
window.mimeeqApp.actions.havePermissions(['EXPORT_OBJ', 'EXPORT_STL'])
.then(canExport => {
document.getElementById('export-button').style.display =
canExport ? 'block' : 'none';
});
Param
Array of permission identifiers to check
Basket
prepareCartImage
prepareCartImage:
PrepareCartImage
Function
Prepares an image for inclusion in a cart item.
This method uploads a product image (provided as a base64 string) to storage and returns a reference path that can be used when adding items to the cart. The image serves as a visual representation of the specific configuration being ordered.
Cart images improve the shopping experience by providing visual confirmation of selected products in the cart, order confirmation emails, and order history.
Example
// Create an image of the current configuration for a cart item
window.mimeeqApp.utils.takeScreenshot('jpg', 800)
.then(async (imageBase64) => {
const imagePath = await window.mimeeqApp.actions.prepareCartImage(
imageBase64,
'cart_123',
'item_456'
);
// Add the item to cart with the prepared image
addToCartWithImage(imagePath);
});
Param
Base64-encoded image data
Param
ID of the cart the image will be associated with
Param
ID of the specific cart item the image represents
Basket Operations
addItemToCart
addItemToCart:
AddItemToCart
Function
Adds an item to the shopping cart.
This method allows you to programmatically add a configured product to the cart, including all its selected options, pricing information, and quantity. It's the digital equivalent of placing a physical product in a shopping basket, ensuring all the customizations and pricing details are accurately captured.
Business value:
- Enables seamless e-commerce integration with your configurator
- Allows for one-click add-to-cart functionality from custom interfaces
- Supports automated ordering processes or bulk-add operations
- Maintains all configuration details for manufacturing or fulfillment
Example
// Add a configured desk to the cart
const cartItem = {
productId: 'prod_desk_123',
productName: 'Executive Desk',
variantCode: 'Width-a9&Material-b5&Color-c3',
quantity: 2,
companyId: 'company_456',
priceType: 'SALE',
sku: 'DESK-EX-001',
isModular: false,
// other required properties...
};
await window.mimeeqApp.actions.addItemToCart(cartItem);
console.log('Product added to cart successfully');
Param
Complete definition of the item to add, including product details, pricing context, and quantity
Throws
Will throw an error if the item cannot be added or if required information is missing
Emits
mimeeq-basket-updated When the item is successfully added to the cart, providing updated cart state
createCart
createCart:
CreateCart
Function
Creates a new empty shopping cart.
This method initializes a new cart in the system, generating a unique identifier that can be used for subsequent cart operations. Creating a new cart is typically the first step in a shopping journey for a new session or after a previous cart has been completed or abandoned.
The created cart will be associated with the current user if they are authenticated, or tracked via session for guest users. Multiple carts can exist simultaneously, allowing for scenarios like saved carts, wish lists, or quote comparisons.
Example
// Create a new empty cart at the beginning of a shopping session
const { cartId } = await window.mimeeqApp.actions.createCart();
console.log(`New cart created with ID: ${cartId}`);
// Store the cart ID for future operations
sessionStorage.setItem('currentCartId', cartId);
getCartForPreview
getCartForPreview:
GetCartForPreview
Function
Retrieves comprehensive cart data formatted for display or email sharing.
This method fetches complete cart information including all items, pricing details, customer contact information, and submission data. The returned data is structured for presentation in review screens, email previews, or order confirmation displays.
The cart preview includes not only the basic product information but also calculates totals, applies any price modifiers or discounts, and formats custom fields for easy reading.
Example
// Retrieve a cart for preview before submission
const cartPreview = await window.mimeeqApp.actions.getCartForPreview('cart_123456');
// Display cart summary information
document.getElementById('cart-total').textContent =
`${cartPreview.totalValue} ${cartPreview.currency}`;
// Display all items in the cart
const itemsList = document.getElementById('cart-items');
cartPreview.cartItems.forEach(item => {
itemsList.innerHTML += `<li>${item.quantity}x ${item.productName}</li>`;
});
Param
The unique identifier for the cart to retrieve
Throws
Will throw an error if the cart cannot be found or if access is denied
getCartItems
getCartItems:
GetCartItems
Function
Retrieves all items currently in the specified cart.
This method fetches the full list of products that have been added to a cart, including their quantities, configurations, and current prices. It's essential for displaying cart contents, calculating totals, or implementing cart management interfaces.
The response includes complete item details that can be used to render cart items, allow quantity adjustments, show product thumbnails, and display price information.
If the cart is not accessible (e.g., closed, doesn't exist, or forbidden), the method returns an object with a code indicating the specific issue rather than throwing an error.
Example
// Fetch and display all items in the current cart
const cartItems = await window.mimeeqApp.actions.getCartItems('cart_123456');
// Check if we received an error code
if ('code' in cartItems) {
if (cartItems.code === 'CART_CLOSED') {
showMessage('This cart has already been submitted');
} else if (cartItems.code === 'CART_NOT_FOUND') {
showMessage('Cart not found - please create a new one');
}
return;
}
// Display the cart items
cartItems.forEach(item => {
addItemToCartDisplay(item);
});
Param
The unique identifier for the cart to retrieve items from
getCartSubmissionForm
getCartSubmissionForm:
GetCartSubmissionFormAction
Function
Retrieves the custom fields and form structure required for cart submission.
This method fetches the collection of form fields needed to complete a cart submission, including both standard fields (name, email, etc.) and any custom fields defined for the cart submission process. The returned fields contain all necessary validation rules, display properties, and ordering information.
The form structure is typically used to build a dynamic checkout form that collects the required customer information before finalizing an order. Field types can include text inputs, dropdowns, checkboxes, and more complex components like rich text areas.
Example
// Fetch the submission form structure and build a dynamic form
const formFields = await window.mimeeqApp.actions.getCartSubmissionForm('cart_123456');
// Sort fields by their ordinal position
formFields.sort((a, b) => a.ordinal - b.ordinal);
// Create form elements for each field
const formContainer = document.getElementById('checkout-form');
formFields.forEach(field => {
const formControl = createFormControl(field);
formContainer.appendChild(formControl);
});
Param
The unique identifier for the cart
Throws
Will throw an error if the cart ID is missing or if form retrieval fails
preSubmitCart
preSubmitCart:
PreSubmitCart
Function
Saves partial contact information without fully submitting the cart.
This method allows for incrementally saving customer information during the checkout process without finalizing the order. It's useful for multi-step checkout flows, saving checkout progress, or preparing a cart for later submission.
When contact information is pre-submitted, it's associated with the cart but doesn't trigger the final submission workflow. This allows for scenarios like saving contact details while continuing to shop, validating information before final submission, or creating a draft order to be finalized later.
The method also returns updated price modifiers which may have changed based on the submitted information (e.g., discount eligibility based on company or region).
Example
// Save contact information from the first checkout step
const contactInfo = {
fullName: 'Jane Smith',
email: '[email protected]',
companyName: 'Acme Corp',
language: 'en',
// Partial data - more fields will be added in subsequent steps
};
const result = await window.mimeeqApp.actions.preSubmitCart('cart_123456', contactInfo);
// Check if any price modifiers were applied based on the contact info
if (result.priceModifiers.length > 0) {
updatePricingDisplay(result.priceModifiers);
}
Param
The unique identifier for the cart
Param
Partial contact and submission information to save
Throws
Will throw an error if the cart ID is missing or if pre-submission fails
recalculateCart
recalculateCart:
RecalculateCart
Function
Recalculates all prices in the cart based on specified pricing parameters.
This method updates all item prices in the cart according to the provided pricing context, which can include company-specific pricing, price types (cost, retail, sale), price list groups, and template-specific pricing rules. It's essential for ensuring accurate pricing when the pricing context changes during the shopping process.
Common scenarios for recalculation include:
- When a salesperson switches the company they're ordering on behalf of
- When changing between price types (e.g., from retail to wholesale pricing)
- When specific discount programs or price lists are applied
- When the embedded template context changes, affecting pricing rules
The method returns updated cart items with recalculated prices and any applicable price modifiers (discounts, surcharges, etc.).
Example
// Recalculate cart prices when switching to wholesale pricing for a dealer
const updatedCart = await window.mimeeqApp.actions.recalculateCart(
'cart_123456', // Cart ID
'company_dealer_789', // Dealer company ID
'WHOLESALE', // Price type
'dealer_program_A' // Price list group
);
// Update the UI with new pricing
updateCartDisplay(updatedCart.cartItems);
// Show any applied discounts or surcharges
if (updatedCart.priceModifiers.length > 0) {
showPriceModifiers(updatedCart.priceModifiers);
}
Param
The unique identifier for the cart to recalculate
Param
Optional company ID to use for company-specific pricing
Param
Optional price type to use (e.g., 'COST', 'RRP', 'SALE')
Param
Optional price list group to apply for special pricing programs
Param
Optional ID of the embed template context
Throws
Will throw an error if recalculation fails or the cart is inaccessible
Emits
mimeeq-basket-updated When prices have been recalculated, providing updated cart state
removeCartItem
removeCartItem:
RemoveCartItem
Function
Removes a specific item from the cart.
This method deletes a single item from the cart based on its unique identifier. It's equivalent to taking a product out of your shopping basket before checkout, and provides immediate feedback to reflect the updated cart state.
Business value:
- Gives customers control to refine their selections before purchase
- Immediately updates pricing totals to reflect removed items
- Supports dynamic cart management in custom interfaces
- Helps prevent order errors by allowing easy removal of unwanted items
Example
// Remove an item when the user clicks a "Remove" button
document.querySelector('.remove-item-btn').addEventListener('click', async (e) => {
const cartId = e.target.dataset.cartId;
const itemId = e.target.dataset.itemId;
try {
await window.mimeeqApp.actions.removeCartItem(cartId, itemId);
// Remove the item from the UI
document.getElementById(`cart-item-${itemId}`).remove();
// Update cart totals
updateCartTotals();
} catch (error) {
showErrorMessage('Could not remove item from cart');
}
});
Param
The unique identifier for the cart
Param
The unique identifier for the specific item to remove
Throws
Will throw an error if the cart or item ID is missing or if removal fails
Emits
mimeeq-basket-updated When the item is successfully removed, providing updated cart state
submitCart
submitCart:
SubmitCart
Function
Finalizes and submits a cart for processing.
This method completes the checkout process by submitting the cart with all required customer information. It transforms the cart into an order that can be processed through subsequent fulfillment workflows. Once submitted, the cart is typically locked and cannot be modified further.
The submission process:
- Validates all required fields are present and properly formatted
- Finalizes pricing calculations and applies any last-minute price modifiers
- Generates a unique reference code for tracking the submitted order
- Changes the cart status to prevent further modifications
- Triggers any configured notifications (e.g., email confirmations)
This is typically the final step in the purchasing process within the configurator.
Example
// Submit a cart with complete customer information
const customerInfo = {
fullName: 'John Doe',
email: '[email protected]',
phone: '+1 555-123-4567',
companyName: 'Acme Corporation',
address: '123 Main St, Anytown, USA',
language: 'en',
submittedAt: Date.now(),
notes: 'Please deliver to loading dock B',
// Any custom fields collected during checkout
customFields: {
deliveryPreference: 'morning',
specialInstructions: true
},
parameters: [] // Processed custom fields
};
const result = await window.mimeeqApp.actions.submitCart('cart_123456', customerInfo);
// Show confirmation with reference code
showOrderConfirmation(result.referenceCode);
Param
The unique identifier for the cart to submit
Param
Complete customer information and submission details
Throws
Will throw an error if submission fails due to missing information or system issues
Emits
mimeeq-basket-submitted When the cart is successfully submitted, providing the reference code
CameraControl
decreaseZoom
decreaseZoom:
DecreaseZoom
Function
Decreases the camera zoom level to see more of the product and its surroundings.
This action moves the camera farther away from the product, giving viewers a broader perspective. It's ideal for showcasing the product's overall proportions, viewing larger furniture arrangements, or seeing how multiple components fit together.
Business value:
- Helps customers understand the overall size and scale of products
- Shows how products fit within an environment or alongside other pieces
- Provides context for furniture arrangements or room layouts
Example
// Add a "zoom out" button to your product page
document.getElementById('zoom-out-button').addEventListener('click', () => {
window.mimeeqApp.actions.decreaseZoom();
});
// Zoom out by a larger amount for a dramatic wide view
window.mimeeqApp.actions.decreaseZoom(2);
Param
How much to zoom out - larger values create a more dramatic change (optional)
freezeCanvasScrolling
freezeCanvasScrolling:
FreezeCanvasScrolling
Function
Disables scrolling and zooming interactions on the 3D view.
This action prevents users from accidentally changing the camera position through scroll or pinch gestures. It's useful when you want to maintain a specific product view or when the 3D model is displayed in a scrollable page where normal scrolling should move the page, not zoom the product.
Business value:
- Maintains consistent product views in presentations or guided experiences
- Prevents accidental zoom changes when scrolling through product pages
- Creates a more controlled viewing experience on touch devices
- Allows for custom zoom controls that match your interface design
Example
// Freeze camera position when entering presentation mode
document.getElementById('enter-presentation').addEventListener('click', () => {
window.mimeeqApp.actions.freezeCanvasScrolling();
});
increaseZoom
increaseZoom:
IncreaseZoom
Function
Increases the camera zoom level to see finer details of the product.
This action brings the camera closer to the product, revealing intricate details and textures. It's perfect for examining specific features, materials, finishes, or connection points that might not be visible from a distance.
Business value:
- Showcases craftsmanship and quality details that differentiate premium products
- Helps customers inspect important functional features before purchase
- Allows salespeople to highlight specific selling points during presentations
Example
// Add a "zoom in" button to focus on product details
document.getElementById('zoom-in-button').addEventListener('click', () => {
window.mimeeqApp.actions.increaseZoom();
});
// Zoom in more dramatically to focus on a specific detail
window.mimeeqApp.actions.increaseZoom(1.5);
Param
How much to zoom in - larger values create a more dramatic change (optional)
registerSceneCanvasView
registerSceneCanvasView:
RegisterSceneCanvasView
Function
Adds a new viewing canvas that shows the same 3D product from the same camera angle.
This action creates an additional view of the product that shares the main camera position. It's like adding a second monitor that shows the same content - both views stay synchronized as the camera moves, but they can be displayed in different locations or at different sizes in your interface.
Business value:
- Enables side-by-side comparison views of the same product
- Supports picture-in-picture or detail views alongside the main product view
- Creates synchronized product views for different screen regions or devices
- Allows innovative UI layouts with multiple perspectives on the product
Example
// Create a picture-in-picture thumbnail view of the product
const thumbnailCanvas = document.getElementById('product-thumbnail');
window.mimeeqApp.actions.registerSceneCanvasView(thumbnailCanvas);
Param
The HTML canvas element where the additional view should appear
restoreCameraPosition
restoreCameraPosition:
RestoreCameraPosition
Function
Resets the camera to the default product view or a specified custom position.
This action returns the camera to its original position, providing a consistent starting point for viewing the product. It's like pressing a "reset view" button that clears any navigation or zoom adjustments made by the user.
Business value:
- Creates a consistent baseline view for product presentations
- Helps disoriented users quickly return to a standard product view
- Ensures specific product features are properly highlighted in the default view
- Supports guided tours that always begin from the same perspective
Example
// Add a "reset view" button to your interface
document.getElementById('reset-view').addEventListener('click', () => {
window.mimeeqApp.actions.restoreCameraPosition();
});
// Jump to a specific predefined camera angle
window.mimeeqApp.actions.restoreCameraPosition(JSON.stringify({
position: {x: -1.5, y: 1.7, z: -5.2},
target: {x: 0, y: 0.6, z: 0}
}));
Param
Optional JSON string defining a specific camera position
setSceneInputCanvas
setSceneInputCanvas:
SetSceneInputCanvas
Function
Designates which canvas should receive user interactions like click, drag, and zoom.
This action specifies which of your canvas views should respond to user input for controlling the camera. Only one canvas can accept interactions at a time, so this lets you choose which one should be the "primary" controller when you have multiple views.
Business value:
- Creates intuitive multi-view experiences where users know which view to interact with
- Enables switching between different interaction surfaces in complex interfaces
- Supports responsive designs where the active view might change based on screen size
- Prevents conflicting inputs when multiple product views are displayed
Example
// Switch the active canvas when selecting a different view
document.getElementById('main-view-tab').addEventListener('click', () => {
const mainCanvas = document.getElementById('main-product-view');
window.mimeeqApp.actions.setSceneInputCanvas(mainCanvas);
});
Param
The HTML canvas element that should receive user interactions
setZoom
setZoom:
SetZoom
Function
Sets a specific zoom level for the camera view.
This action gives you precise control over how close or far the camera is from the product. It's like adjusting a zoom lens on a camera - smaller values bring you closer to examine details, while larger values give you a broader perspective of the whole product.
Business value:
- Creates the perfect framing for product screenshots or presentations
- Helps customers focus on specific details like material textures or connectors
- Provides consistent product views across different devices or screens
Example
// Zoom in close to examine material details
window.mimeeqApp.actions.setZoom(2);
// Zoom out to see the entire product in context
window.mimeeqApp.actions.setZoom(10);
// Create an interactive zoom slider control for your website
const zoomSlider = document.getElementById('zoom-slider');
zoomSlider.addEventListener('input', (e) => {
const zoomLevel = parseFloat(e.target.value);
window.mimeeqApp.actions.setZoom(zoomLevel);
});
Param
The distance of the camera from the product - smaller numbers zoom in closer, larger numbers zoom out further
unfreezeCanvasScrolling
unfreezeCanvasScrolling:
UnfreezeCanvasScrolling
Function
Re-enables normal scrolling and zooming interactions on the 3D view.
This action restores the standard behavior where mouse wheel, trackpad scrolling, and touch gestures can zoom and adjust the camera. Use this to return to the default interactive viewing experience after previously freezing camera controls.
Business value:
- Returns to natural interaction after guided product experiences
- Allows customers to freely explore products at their own pace
- Re-enables intuitive camera controls for detailed product inspection
- Complements guided tours that temporarily restrict camera movement
Example
// Restore normal camera controls when exiting presentation mode
document.getElementById('exit-presentation').addEventListener('click', () => {
window.mimeeqApp.actions.unfreezeCanvasScrolling();
});
unregisterSceneCanvasView
unregisterSceneCanvasView:
UnregisterSceneCanvasView
Function
Removes a previously registered canvas from the 3D viewing system.
This action stops displaying the 3D product on a specific canvas that was previously added with registerSceneCanvasView. It's like disconnecting a secondary monitor - the main view continues to work, but the specified canvas will no longer show the product.
Business value:
- Conserves processing power by removing unnecessary views
- Supports dynamic interface layouts where product views can be added and removed
- Enables temporary comparison views that can be dismissed when no longer needed
- Prevents memory leaks by properly cleaning up unused canvas resources
Example
// Remove a secondary view when closing a comparison panel
document.getElementById('close-comparison').addEventListener('click', () => {
const comparisonCanvas = document.getElementById('comparison-view');
window.mimeeqApp.actions.unregisterSceneCanvasView(comparisonCanvas);
});
Param
The HTML canvas element to remove from the viewing system
zoomOut
zoomOut:
ZoomOut
Function
Automatically frames the entire product perfectly in the viewport.
This action intelligently adjusts the camera position and zoom to ensure the complete product is visible and optimally framed. It's like clicking the "fit to screen" button in design software - instantly giving you the ideal overview of the entire product.
Business value:
- Ensures customers can always see the complete product with one click
- Provides a consistent starting view regardless of previous interactions
- Creates a reliable reset point after customers explore detailed views
Example
// Add a "view entire product" button to your interface
document.getElementById('view-all-button').addEventListener('click', () => {
window.mimeeqApp.actions.zoomOut();
});
Emits
mimeeq-3d-zoom-out-scene When the automatic zoom-to-fit action is performed
Canvas
freezeCanvasScrolling
freezeCanvasScrolling:
FreezeCanvasScrolling
Function
Disables scrolling and zooming interactions on the 3D view.
This action prevents users from accidentally changing the camera position through scroll or pinch gestures. It's useful when you want to maintain a specific product view or when the 3D model is displayed in a scrollable page where normal scrolling should move the page, not zoom the product.
Business value:
- Maintains consistent product views in presentations or guided experiences
- Prevents accidental zoom changes when scrolling through product pages
- Creates a more controlled viewing experience on touch devices
- Allows for custom zoom controls that match your interface design
Example
// Freeze camera position when entering presentation mode
document.getElementById('enter-presentation').addEventListener('click', () => {
window.mimeeqApp.actions.freezeCanvasScrolling();
});
registerSceneCanvasView
registerSceneCanvasView:
RegisterSceneCanvasView
Function
Adds a new viewing canvas that shows the same 3D product from the same camera angle.
This action creates an additional view of the product that shares the main camera position. It's like adding a second monitor that shows the same content - both views stay synchronized as the camera moves, but they can be displayed in different locations or at different sizes in your interface.
Business value:
- Enables side-by-side comparison views of the same product
- Supports picture-in-picture or detail views alongside the main product view
- Creates synchronized product views for different screen regions or devices
- Allows innovative UI layouts with multiple perspectives on the product
Example
// Create a picture-in-picture thumbnail view of the product
const thumbnailCanvas = document.getElementById('product-thumbnail');
window.mimeeqApp.actions.registerSceneCanvasView(thumbnailCanvas);
Param
The HTML canvas element where the additional view should appear
setSceneInputCanvas
setSceneInputCanvas:
SetSceneInputCanvas
Function
Designates which canvas should receive user interactions like click, drag, and zoom.
This action specifies which of your canvas views should respond to user input for controlling the camera. Only one canvas can accept interactions at a time, so this lets you choose which one should be the "primary" controller when you have multiple views.
Business value:
- Creates intuitive multi-view experiences where users know which view to interact with
- Enables switching between different interaction surfaces in complex interfaces
- Supports responsive designs where the active view might change based on screen size
- Prevents conflicting inputs when multiple product views are displayed
Example
// Switch the active canvas when selecting a different view
document.getElementById('main-view-tab').addEventListener('click', () => {
const mainCanvas = document.getElementById('main-product-view');
window.mimeeqApp.actions.setSceneInputCanvas(mainCanvas);
});
Param
The HTML canvas element that should receive user interactions
unfreezeCanvasScrolling
unfreezeCanvasScrolling:
UnfreezeCanvasScrolling
Function
Re-enables normal scrolling and zooming interactions on the 3D view.
This action restores the standard behavior where mouse wheel, trackpad scrolling, and touch gestures can zoom and adjust the camera. Use this to return to the default interactive viewing experience after previously freezing camera controls.
Business value:
- Returns to natural interaction after guided product experiences
- Allows customers to freely explore products at their own pace
- Re-enables intuitive camera controls for detailed product inspection
- Complements guided tours that temporarily restrict camera movement
Example
// Restore normal camera controls when exiting presentation mode
document.getElementById('exit-presentation').addEventListener('click', () => {
window.mimeeqApp.actions.unfreezeCanvasScrolling();
});
unregisterSceneCanvasView
unregisterSceneCanvasView:
UnregisterSceneCanvasView
Function
Removes a previously registered canvas from the 3D viewing system.
This action stops displaying the 3D product on a specific canvas that was previously added with registerSceneCanvasView. It's like disconnecting a secondary monitor - the main view continues to work, but the specified canvas will no longer show the product.
Business value:
- Conserves processing power by removing unnecessary views
- Supports dynamic interface layouts where product views can be added and removed
- Enables temporary comparison views that can be dismissed when no longer needed
- Prevents memory leaks by properly cleaning up unused canvas resources
Example
// Remove a secondary view when closing a comparison panel
document.getElementById('close-comparison').addEventListener('click', () => {
const comparisonCanvas = document.getElementById('comparison-view');
window.mimeeqApp.actions.unregisterSceneCanvasView(comparisonCanvas);
});
Param
The HTML canvas element to remove from the viewing system
Configuration Actions
markOptionByBlockNameAndOptionCode
markOptionByBlockNameAndOptionCode:
MarkOptionByBlockNameAndOptionCode
Function
Selects an option using human-readable block name and option code, or sets a value for special widgets.
This convenience function allows for selecting options using their business identifiers rather than internal IDs. It's particularly useful for integrations and automated configurations where human-readable references are preferred over technical identifiers.
For standard option blocks, this method finds the option by its code and selects it. For special widget types (slider, text, number, color, etc.), the second parameter is interpreted as the input value rather than an option code.
Supported Widget Types
| Widget Type | Second Parameter | Description |
|---|---|---|
| Standard (dropdown, swatch, etc.) | optionCode | The code of the option to select |
| Slider | inputValue | Numeric value within the slider's range |
| Text | inputValue | Text string value |
| Number | inputValue | Numeric value |
| Color | colorValue | Hex color value (e.g., "#FF0000") |
For more complex widgets (image, print on demand, engrave) or full control,
use markOption directly. See the Programmatic Configuration Control guide.
Examples
// Select a standard option by code
await markOptionByBlockNameAndOptionCode("TableTop", "FINISH-OAK");
// Set a slider value
await markOptionByBlockNameAndOptionCode("Width", 150);
// Set a text input value
await markOptionByBlockNameAndOptionCode("CustomLabel", "My Product");
// Set a number input value
await markOptionByBlockNameAndOptionCode("Quantity", "25");
// Set a custom color
await markOptionByBlockNameAndOptionCode("CustomColor", "#3498db");
Param
The display name of the block containing the option
Param
The option code for standard widgets, or the input value for special widgets (slider, text, number, color)
setConfigurationCode
setConfigurationCode:
SetConfigurationCode
Function
Function signature for directly setting the configuration code of a product.
This function allows for setting the complete configuration code at once, which updates all options simultaneously. This is useful for restoring saved configurations, applying presets, or implementing "popular configurations" functionality.
When the code is applied, all options defined in the code will be selected and any options not included will revert to their default values.
Example
// Set a complete configuration for a chair product
setConfigurationCode("Width-a1&Fabric-b3&Color-c2&Legs-a4");
Param
The complete configuration code string
triggerFinishEvent
triggerFinishEvent:
TriggerFinishEvent
Function
Function signature for triggering the finish event for a product configuration.
This function initiates the completion process for a product configuration, preparing all the necessary data and dispatching the appropriate events. It's used when a user completes their configuration and is ready to proceed with adding to cart, saving, or sharing.
The variant parameter determines the specific action to take, such as adding to cart, displaying the summary, or generating sharing links.
Example
// Trigger the "add to cart" action for the current configuration
triggerFinishEvent('basket');
// Trigger the summary display for the current configuration
triggerFinishEvent('summary');
Param
The type of finish action to perform ('basket', 'summary', etc.)
Emits
mimeeq-show-basket-loader When the add to cart process begins
Emits
mimeeq-add-to-cart When a product is added to the cart
Emits
mimeeq-select-product When in selector mode and product is selected
Emits
mimeeq-show-summary When showing the configuration summary
Emits
mimeeq-app-url-change When the URL needs updating (non-modular)
Emits
mmq-app-url-change-sandbox For sandbox environment URL changes
Exporters
exportGlb
exportGlb:
ExportGLB
Function
Exports the current product configuration as a GLB 3D model file.
This action generates a downloadable 3D model of the product with all current customizations applied. The GLB format is widely supported by modern 3D software, AR applications, and online platforms, making it ideal for virtual staging, further design work, or digital presentations.
Business value:
- Allows customers to use configured products in their own design software
- Enables architects and designers to integrate products into their projects
- Supports AR experiences on mobile devices or headsets
- Facilitates virtual staging for real estate and interior design
Example
// Add an "export 3D model" button to your configurator
document.getElementById('export-3d-button').addEventListener('click', () => {
window.mimeeqApp.actions.exportGlb();
});
Emits
mimeeq-3d-before-export-scene When the export process begins
Emits
mimeeq-3d-after-export-scene When the export is complete and file download starts
exportObj
exportObj:
ExportOBJ
Function
Exports the current product configuration as an OBJ 3D model file.
This action generates a downloadable 3D model in OBJ format, which is compatible with virtually all 3D modeling software. OBJ is particularly valuable for design workflows that require material information and is supported by legacy systems.
Business value:
- Provides compatibility with older design software and systems
- Preserves material definitions for realistic rendering in third-party applications
- Enables integration with established design workflows and archives
- Supports custom product visualization in marketing materials
Example
// Add an "export for design software" button
document.getElementById('export-for-design-button').addEventListener('click', () => {
window.mimeeqApp.actions.exportObj();
});
Emits
mimeeq-3d-before-export-scene When the export process begins
Emits
mimeeq-3d-after-export-scene When the export is complete and file download starts
exportStl
exportStl:
ExportSTL
Function
Exports the current product configuration as an STL file for 3D printing or manufacturing.
This action creates a downloadable 3D model in STL format, the industry standard for 3D printing, rapid prototyping, and CNC manufacturing. STL files contain the precise geometry needed to physically produce the product or a scale model.
Business value:
- Enables direct-to-manufacturing workflows from the configurator
- Allows customers to 3D print scale models or prototypes
- Supports industrial design and engineering teams creating physical samples
- Bridges the gap between digital configuration and physical production
Example
// Add a "prepare for 3D printing" button to your interface
document.getElementById('3d-print-button').addEventListener('click', () => {
window.mimeeqApp.actions.exportStl();
});
Emits
mimeeq-3d-before-export-scene When the export process begins
Emits
mimeeq-3d-after-export-scene When the export is complete and file download starts
exportUsdz
exportUsdz:
ExportUSDZ
Function
Exports the current product configuration as a USDZ 3D model file.
This action generates a downloadable 3D model of the product with all current customizations applied. The USDZ format is Apple's AR file format optimized for iOS and macOS devices, making it perfect for AR previews, Quick Look integration, and Apple-ecosystem AR experiences.
Business value:
- Enables immersive AR experiences on iOS devices without requiring an app
- Allows customers to visualize products in their real environment
- Integrates with Apple's AR Quick Look for seamless AR viewing
- Supports high-quality materials and textures for photorealistic AR
- Enhances e-commerce with "View in Your Space" capabilities
Example
// Add an "export for Apple AR" button to your configurator
document.getElementById('export-usdz-button').addEventListener('click', () => {
window.mimeeqApp.actions.exportUsdz();
});
Emits
mimeeq-3d-before-export-scene When the export process begins
Emits
mimeeq-3d-after-export-scene When the export is complete and file download starts
generateProductPDF
generateProductPDF:
GenerateProductPDF
Function
Generates a comprehensive PDF document for the current product configuration.
This method creates a professionally formatted PDF that includes detailed information about the configured product. The content typically includes product images, selected options, specifications, pricing, and any other relevant tabs from the product interface.
The PDF can be customized through configuration options, including page layout, branding, sections to include, and formatting. Custom document templates can be applied for brand-consistent documentation.
Product PDFs serve as comprehensive documentation for configured products, useful for sharing with clients, keeping for reference, or including in quotes and orders.
Example
// Generate a PDF including all product tabs
const allTabs = window.mimeeqApp.observers.product.tabs.getValue().newValue || [];
window.mimeeqApp.actions.generateProductPDF(allTabs);
// Generate a PDF with only specific tabs and custom formatting
const selectedTabs = allTabs.filter(tab =>
['configuration', 'finishes'].includes(tab.tabType)
);
window.mimeeqApp.actions.generateProductPDF(
selectedTabs,
translateMessage, // Translation function
{
logoPosition: 'RIGHT',
displayLogoAt: 'FIRST_PAGE',
logo: 'https://example.com/company-logo.png'
}
);
Param
Array of product tabs to include in the PDF
Param
Optional translation function for localized content
Param
Optional custom configuration for PDF formatting and branding
Emits
mimeeq-pdf-generate-done When PDF generation is complete
saveImage
saveImage:
SaveImage
Function
Captures and saves the current product view as a high-quality image.
This action creates a professional product image of the current configuration from the current camera angle. It's like taking a screenshot, but with higher quality and more control over the output format and resolution - perfect for creating marketing materials, design presentations, or sharing design concepts.
Business value:
- Creates professional product imagery without photography
- Generates consistent product visuals for catalogs and websites
- Enables sharing of custom configurations with clients or team members
- Supports creation of marketing materials for configured products
Example
// Create a high-resolution PNG image for a presentation
window.mimeeqApp.actions.saveImage('png', 2048);
// Create a JPEG with white background for a product catalog
window.mimeeqApp.actions.saveImage('jpg', 1200, '#FFFFFF');
// Add a "download product image" button to your interface
document.getElementById('download-image').addEventListener('click', () => {
window.mimeeqApp.actions.saveImage('png', 1800);
});
Emits
mimeeq-3d-before-export-image When the image generation begins
Emits
mimeeq-3d-after-export-image When the image is complete and download starts
Param
The image format to save ('png', 'jpg', or 'jpeg')
Param
The width of the output image in pixels (height will adjust automatically)
Param
The color for image background (for formats without transparency)
showExportImageModal
showExportImageModal:
ShowExportImageModal
Function
Opens the image export dialogue.
This method displays a modal interface that allows users to export high-quality images of the current product configuration. Users can select image format, resolution, background options, and other settings.
High-quality product images are valuable for marketing materials, presentations, catalogs, and client communications.
Example
// Add a custom image export button to your interface
document.getElementById('custom-image-btn').addEventListener('click', () => {
window.mimeeqApp.actions.showExportImageModal();
});
Fires
Mimeeq-internal-show-export-image
showExportModal
showExportModal:
ShowExportModal
Function
Opens the 3D model export dialogue.
This method displays a modal interface that allows users to export the current product configuration as a 3D model file. Users can select from available formats (such as OBJ, STL, GLB) and initiate the download.
Exporting 3D models enables further use of the configured product in CAD software, space planning tools, or other 3D environments.
Example
// Add a custom export button to your interface
document.getElementById('custom-export-btn').addEventListener('click', () => {
window.mimeeqApp.actions.showExportModal();
});
Fires
Mimeeq-internal-show-export
showExportPDF
showExportPDF:
ShowExportPDF
Function
Opens the PDF export dialogue for the current configuration.
This method displays a modal interface that allows users to select which content to include in a PDF document of the current product configuration. Users can choose specific tabs, customize the output, and generate high-quality documentation of their configured product.
PDF exports provide comprehensive documentation for configurations that can be shared with clients, saved for reference, or used in procurement processes.
Example
// Add a custom PDF export button to your interface
document.getElementById('custom-pdf-btn').addEventListener('click', () => {
window.mimeeqApp.actions.showExportPDF();
});
Fires
Mimeeq-internal-show-export-pdf
Favorites
createFavouriteCollection
createFavouriteCollection:
CreateFavouriteCollection
Function
Creates a new collection for organizing saved favorites.
This method allows users to create a new organizational folder for storing their saved product configurations and modular scenes. Collections help users categorize their favorites based on projects, clients, themes, or any other grouping that makes sense for their workflow.
Collections can be either private (visible only to the user) or public (visible to all users within the organization), providing flexibility for both personal use and team collaboration.
Example
// Create a new private collection for a specific project
const newCollectionId = await window.mimeeqApp.actions.createFavouriteCollection(
'Spring 2025 Collection', // Collection name
'private' // Visibility type
);
if (newCollectionId && typeof newCollectionId === 'string') {
console.log(`New collection created with ID: ${newCollectionId}`);
// Save the current configuration to this new collection
const configCode = window.mimeeqApp.observers.product.configurationCode.getValue().newValue;
window.mimeeqApp.actions.saveFavouriteConfiguration(configCode, [newCollectionId]);
}
Param
Display name for the new collection
Param
Whether the collection is 'private' (visible only to the creator) or 'public' (visible to all users)
Emits
mimeeq-favourites-add-collection When a new collection is successfully created
getFavouriteCollections
getFavouriteCollections:
GetFavouriteCollections
Function
Retrieves all available favorite collections for the current user.
This method fetches the complete list of collections that the current user has access to, including both their private collections and any public collections shared within the organization. Collections serve as folders for organizing saved product configurations and modular scenes.
The returned collections can be used to populate collection selectors, organize favorite management interfaces, or filter favorites by collection.
Example
// Fetch and display all available collections in a dropdown
const collections = await window.mimeeqApp.actions.getFavouriteCollections();
const collectionSelect = document.getElementById('collection-select');
collectionSelect.innerHTML = '';
// Add a default option
const defaultOption = document.createElement('option');
defaultOption.value = '';
defaultOption.textContent = 'Select a collection...';
collectionSelect.appendChild(defaultOption);
// Add each collection as an option
collections.forEach(collection => {
const option = document.createElement('option');
option.value = collection.favouriteCollectionId;
option.textContent = collection.favouriteCollectionName +
(collection.collectionType === 'public' ? ' (Public)' : '');
collectionSelect.appendChild(option);
});
getFavouriteItems
getFavouriteItems:
GetFavouriteItems
Function
Retrieves all saved favorite items for the current user.
This method fetches the complete list of saved product configurations and modular scenes that the current user has access to. The returned data includes both private favorites (created by the user) and public favorites (shared across the organization), each organized within their respective collections.
This comprehensive favorites data can be used to build favorites browsers, selection interfaces, or to implement "recently used" features.
Example
// Fetch and display all favorites organized by collection type
const favorites = await window.mimeeqApp.actions.getFavouriteItems();
// Display public favorites
const publicContainer = document.getElementById('public-favorites');
publicContainer.innerHTML = '<h3>Public Favorites</h3>';
if (favorites.publicFavouriteCollections.length === 0) {
publicContainer.innerHTML += '<p>No public favorites available</p>';
} else {
favorites.publicFavouriteCollections.forEach(fav => {
const favElement = createFavoriteElement(fav);
publicContainer.appendChild(favElement);
});
}
// Display user's private favorites
const userContainer = document.getElementById('my-favorites');
userContainer.innerHTML = '<h3>My Favorites</h3>';
if (favorites.userFavouriteCollections.length === 0) {
userContainer.innerHTML += '<p>You haven\'t saved any favorites yet</p>';
} else {
favorites.userFavouriteCollections.forEach(fav => {
const favElement = createFavoriteElement(fav);
userContainer.appendChild(favElement);
});
}
saveFavouriteConfiguration
saveFavouriteConfiguration:
SaveFavouriteConfiguration
Function
Saves the current product configuration as a favorite.
This method saves the current standard product configuration (with all selected options) to one or more favorite collections. It can be used to bookmark particularly useful or attractive configurations for later reference or to share configurations with colleagues.
If the configuration already exists in some collections but not in others, the method will intelligently update collection assignments, adding it to new collections and removing it from collections not included in the provided list.
Example
// Save the current configuration to two collections when the user clicks "Save"
document.getElementById('save-config-btn').addEventListener('click', async () => {
// Get the current configuration code
const configCode = window.mimeeqApp.observers.product.configurationCode.getValue().newValue;
// Get the selected collection IDs from checkboxes
const selectedCollections = Array.from(
document.querySelectorAll('input[name="collections"]:checked')
).map(cb => cb.value);
if (selectedCollections.length === 0) {
alert('Please select at least one collection');
return;
}
const success = await window.mimeeqApp.actions.saveFavouriteConfiguration(
configCode,
selectedCollections
);
if (success) {
showNotification('Configuration saved to favorites');
} else {
showNotification('Failed to save configuration', 'error');
}
});
Param
The configuration code representing all selected options
Param
Array of collection IDs to save this configuration to
Emits
mimeeq-favourites-remove-product When removing from all collections
Emits
mimeeq-favourites-add-product When adding to at least one collection
saveFavouriteScene
saveFavouriteScene:
SaveFavouriteScene
Function
Updates an existing saved modular scene with the current state.
This method saves the current modular scene layout and component configurations over an existing saved favorite. This is useful for updating a scene after making modifications without creating a new entry or changing its name.
The method will only work if the current scene was previously loaded from a favorite;
attempting to update a scene that hasn't been saved yet will fail. For new scenes,
use saveFavouriteSceneAs instead.
Example
// Update the current scene when the user clicks the "Update" button
document.getElementById('update-scene-btn').addEventListener('click', async () => {
// Check if we have a loaded scene to update
const sceneShortcode = window.mimeeqApp.observers.modular.favSceneShortcode.getValue().newValue;
if (!sceneShortcode) {
showNotification('This is a new scene that hasn\'t been saved yet. Please use "Save As" instead.', 'warning');
return;
}
const success = await window.mimeeqApp.actions.saveFavouriteScene();
if (success) {
showNotification('Scene updated successfully');
} else {
showNotification('Failed to update scene', 'error');
}
});
Emits
mimeeq-modular-save-scene When the scene is successfully saved
saveFavouriteSceneAs
saveFavouriteSceneAs:
SaveFavouriteSceneAs
Function
Saves the current modular scene as a new favorite with a custom name.
This method captures the complete current state of a modular scene—including all components, their positions, configurations, and relationships—and saves it as a new favorite entry in the specified collections. This allows complex layouts to be saved and restored later, shared with colleagues, or used as starting points for similar designs.
Unlike saveFavouriteScene, this method always creates a new entry rather than updating
an existing one, and requires providing a name for the new scene.