🚀 UI Package Integration Guide
The OV25-UI package provides a seamless way to integrate Orbital Vision's 3D product configurator directly into your existing website or application. Instead of manually using postMessage and an iframe, this package allows you to inject configurator components directly into your DOM elements.
📦 Installation
Install the package using npm:
💡 Note: Always use
@latestto ensure you have the most recent version with all the latest features and bug fixes.
🎯 Quick Start
The injectConfigurator function allows you to embed the configurator into your page. It has a variety of optional parameters that allow you to customize the configurator to your needs.
Minimal Example
🎭 Choose Your Display Mode
The OV25-UI package offers multiple ways to display the configurator on your page. Snap2 Configurators can only be displayed in Dialog Mode.
Inline Gallery Mode (galleryId)
Use this when you want the configurator to render directly on the page when it loads. The 3D viewer will be embedded inline within your specified element.

Best for: Displaying specific product configurations without the option to customize.
Inline Gallery Mode with Variants (galleryId and variantsId)
If you also want to place variant controls on the page, you must specify variantsId. This will render the variant controls as a set of buttons. When controls are opened, the configurator will become fullscreen and options will be displayed.

Best for: Product listing pages, catalog views, full variant and pricing integration.
Inline Gallery Mode with Inline Variants (galleryId and variantsId with inline display)
This mode displays variant controls directly within the main page layout, rather than opening as a fullscreen panel when clicked. The variant controls are rendered inline alongside the 3D configurator, providing a seamless user experience without modal overlays. The 3D configurator can still be fullscreened.

Best for: Product pages where you want variant controls always visible, e-commerce sites with custom layouts, and scenarios where fullscreen configurators are not desired.
Snap2 Dialog Mode (configureButtonId)
This mode is only available for Snap2 configurators. Your productLink must be of the form snap2/12345. Use this when you want to show a "Configure" button that opens the configurator in a large dialog overlay when clicked. The configurator doesn't start loading until the button is clicked.

Best for: Snap2 product configurators, when the configurator does not need to be loaded/displayed on initial page load.
🔄 Injecting Multiple Configurators
The injectMultipleConfigurators function allows you to embed multiple configurators on the same page. This is perfect for product comparison pages, catalog views, or any scenario where you need to display multiple products simultaneously.
Example 1: Multiple Standard Configurators
Ideal for product comparison pages with individual product configurators:
Example 2: Multiple Configurators with Variants
Similar to previous example, but each configurator has its own variant selection menu. This can be done with inlinex variants or with the fullscreen variant panel.
Example 3: Multiple Snap2 Configurators
Perfect for showcasing different Snap2 product configurations with configure buttons:
Key Benefits of Multiple Configurators
- Product Comparison: Display multiple products side-by-side for easy comparison
- Range Showcases: Show different product ranges with their variants
- Catalog Views: Create rich product catalogs with interactive 3D previews
Important Notes
- Each configurator requires unique element IDs to avoid conflicts
- For snap2 configurators only the first configurator will be preloaded. The other configurators will be loaded when the configure button is clicked.
🔧 Configuration Options
The injectConfigurator function accepts a comprehensive options object:
Required Parameters
| Parameter | Type | Description |
|---|---|---|
apiKey | string | () => string | Your Orbital Vision API key |
productLink | string | () => string | The ID of the product, range, or snap2 configuration you want to display. In the format 12345 or range/12345 or /snap2/678. |
galleryId | string | { id: string, replace: boolean } | Selector for 3D gallery container - not needed if configureButtonId is provided. |
configureButtonId | string | { id: string, replace: boolean } | Only for Snap2 configurators (galleryId must be of the form snap2/12345). Selector for configure button element - not needed if galleryId is provided. |
🔑 apiKey: You can create a new API key in your dashboard at app.orbital.vision/dashboard/api-keys. Select the Product Configurator Access type.
💡 productLink: You can find the product or range IDs in your dashboard at app.orbital.vision/dashboard/products.
🖼️ galleryId: If provided, the configurator will show on page load, in the location given by the CSS selector.
🔘 configureButtonId: Only for Snap2 configurators (galleryId must be of the form
snap2/12345). If provided, the configurator will not render on page load. The "Configure" button will be rendered in the location given by the CSS selector. When the "Configure" button is clicked, it will open a large dialog and load the configurator.
Optional Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
configurationUuid | string | undefined | For snap2 configurators only. If given, the configurator will load with the saved configuration. configurationUuid can be got by clicking "Share" after customising a snap2 configurator. |
images | string[] | undefined | Array of product image URLs |
deferThreeD | boolean | false | Shows first carousel image while 3D scene loads in background |
showOptional | boolean | true | Shows 'Optional' in the header if an option has a 'None' option. |
priceId | string | { id: string, replace: boolean } | undefined | Selector for price display element. |
nameId | string | { id: string, replace: boolean } | undefined | Selector for product name element. |
variantsId | string | { id: string, replace: boolean } | undefined | Selector for variant selection menu. Without this, user cannot change variants. |
useInlineVariantControls | boolean | false | If true, variant controls will display inline within the main page rather than opening as a fullscreen panel. |
swatchesId | string | { id: string, replace: boolean } | undefined | Selector for swatch book widget. |
carouselId | string | { id: string, replace: boolean } | true | undefined | Selector for product carousel. |
addToBasketFunction | () => void | undefined | Callback when user clicks "Add to Basket" |
buyNowFunction | () => void | undefined | Callback when user clicks "Buy Now" |
addSwatchesToCartFunction | (swatches, swatchRulesData) => void | undefined | Callback to add selected swatches to cart |
logoURL | string | undefined | URL of logo displayed in header of configurator side panel |
mobileLogoURL | string | undefined | Mobile-specific logo URL |
cssString | string | undefined | Optional custom CSS string to apply to all configurator UI. |
hidePricing | boolean | false | If true, pricing will be hidden from the UI. |
🎨 Element Selectors
Element selectors can be either a simple string or a configuration object:
Simple Selector
Advanced Selector with Replacement
⚠️ Replace Mode: When
replace: trueis set, the target element will be completely replaced with the configurator component. Use this when you want the configurator to take over the entire element.
🎨 CSS Customization
All Configurator elements are encapsulated in a shadow DOM. To style them, you can pass your CSS into the cssString parameter.
The configurator components use unique CSS IDs and classes, making customization straightforward. You can easily style individual elements by targeting their specific selectors:
Some elements have data attributes indicating their state.
🏗️ Component Types
1. Product Gallery
The main 3D configurator interface.
2. Price Display
Shows the current product price based on selected options.
3. Product Name
Displays the current product name.
4. Variant Selection Menu
Interactive menu for selecting product variants (colors, materials, etc.).
5. Product Carousel
Image carousel for product photos. The carousel combines your custom images with OV25 product images, displaying your images first in the array.
When carouselId: true is used, the carousel is automatically positioned underneath the configurator iframe. When a specific selector is provided, the carousel replaces that target element instead.
📨 Listening for Product Data
The configurator sends product information via postMessage events that you can listen for in your checkout functions. This allows you to access the current SKU and price information:
Message Data Types
CURRENT_SKU Message
Parsed payload structure:
CURRENT_PRICE Message
Parsed payload structure:
💡 Advanced Examples
Complete E-commerce Integration
Dynamic Configuration
📱 Responsive Design
The configurator components are designed to be responsive. For optimal mobile experience:
⚡ Performance Optimization
Deferred 3D Display
For better initial user experience, especially on mobile devices:
When deferThreeD is enabled, users see the first product image immediately while the 3D scene loads behind the scenes. Once a user interacts with customization options, the 3D scene is ready to display instantly.
Lazy Loading
The configurator automatically handles lazy loading of components. Components are only rendered when their target elements are found in the DOM.
Image Optimization
Provide optimized images for better performance:
🔍 Troubleshooting
Common Issues
Components not appearing:
- Ensure target elements exist in the DOM before calling
injectConfigurator - Check that selectors are correct (including # for IDs and . for classes)
API key errors:
- Confirm your API key is valid and has the correct permissions
- Check that your domain is authorized in the Orbital Vision dashboard
Performance issues:
- Enable
deferThreeDfor mobile devices - Optimize your product images
- Consider loading the configurator only when needed
Debug Mode
Enable console logging for debugging:
Example Implementation
Built with ❤️ by the Orbital Vision team