Skip to content

Script Tag (Direct Integration)

Two maintained direct-integration examples are available:

Starting pointLive pageSource code
Complete project with the built-in Wedding Band UIOpen liveView source
Published Drive file loaded with loadModelByIdOpen liveView source

Add the Wedding Band Builder directly to your website with a single script tag. You get full JavaScript access to the viewer and API on the same page, with no iframes or message passing needed.

Wedding Band Builder with the 3D viewer and the built-in configuration panel

What a direct integration renders: the 3D viewer and the built-in configuration panel, on your own page.

When to Use This

  • You own the page and can add <script> tags
  • You want direct JavaScript access to the API (no postMessage overhead)
  • You want the built-in UI panel, or plan to build a custom one

Make Your Configurator Public

This step assumes the Wedding Band project already exists. If it does not, build and publish it first with Create a Project.

Before embedding, make your configurator accessible:

  1. Open iJewel3D Dashboard
  2. Right-click your Wedding Band Configurator file
  3. Select Make Public

Quick Start

1. Add the script and create a container:

html
<script src="https://releases.ijewel3d.com/libs/webgi-v0/bundle-0.22.0.js"></script>
<script src="https://releases.ijewel3d.com/libs/mini-viewer/0.6.11/bundle.nowebgi.iife.js"></script>
<div id="viewer-root" style="width: 100%; height: 600px;"></div>

2. Initialize the viewer:

html
<script>
  new ijewelViewer.Viewer(document.getElementById('viewer-root'), {
    name: 'Wedding Band Builder',
    version: 'v5',
    basePath: 'https://your-cdn.com/wbb-assets/',
    plugins: {
      WeddingBandBuilder: {
        manifestUrl: 'wedding-band-project.json',
      },
    },
  }, {
    showCard: false,
    showSwitchNode: false,
    showUiButtons: true,
    showConfigurator: false,
    showZoomButtons: true,
    enableZoom: true,
    hideWbbUi: false,
  });
</script>

3. Access the API:

javascript
window.addEventListener('ijewel-viewer-ready', (e) => {
  const viewer = e.detail.viewer;
  const api = viewer.getPluginByType('WeddingBandBuilder').controller;

  // Change ring properties
  api.setWidthMultiplier(1.1);
  api.setMaterial(1, 'Yellow', 'Polished');

  // Listen for price changes
  api.events.on('price:updated', (data) => {
    document.getElementById('price').textContent = `$${data.pricing.totalUsd.toFixed(2)}`;
  });
});

See the documented complete example, or start from either maintained live template above.

Headless Mode (Custom UI)

Set hideWbbUi: true in the viewer options to hide the built-in panel and build your own controls:

javascript
{
  showCard: false,
  showConfigurator: false,
  hideWbbUi: true,
}

The 3D viewer renders full width with no overlaid UI. You control everything through the API by populating dropdowns from catalog methods, wiring controls to setters, and listening for events.

See Custom UI (Headless) for a full guide on building custom controls.

Theming

Customize the built-in panel's appearance to match your brand:

javascript
api.setTheme('luxury-gold');

// Or with custom colors and fonts
api.setTheme({
  preset: 'modern-minimal',
  colors: { primary: '#2E5B3C', background: '#F5F7F5' },
  fonts: {
    body: "'Cormorant Garamond', serif",
    googleFonts: ['Cormorant+Garamond:wght@400;500;600'],
  },
});

Available presets: default, luxury-gold, modern-minimal, dark, rose-elegant, coral-modern, fresh-teal, minimal-blue, warm-beige, classic-gold, ijewel. See Theming & Branding for full customization options.

Framework Examples

FrameworkWhat You GetExample
Vanilla JSPlain HTML/JS, no build stepView example
ReactComponent + hooks, headless variantView example
Vue 3Composable + SFC, headless variantView example
Next.jsClient component, App Router + Pages RouterView example
AngularService + Component, RxJS observablesView example
SvelteComponent with slots, headless variantView example

Error Handling

javascript
api.events.on('error', (err) => {
  console.error(`[${err.source}] ${err.message}`);
});

Multiple Viewers

You can have multiple viewers on one page. Each gets its own API instance:

javascript
const viewer1 = new ijewelViewer.Viewer(root1, project1, options);
const viewer2 = new ijewelViewer.Viewer(root2, project2, options);
Configuration Reference

Project Options

PropertyTypeDescription
namestringDisplay name shown in the loading screen
versionstringProject version (use 'v5')
basePathstringBase URL for resolving asset paths in the manifest
plugins.WeddingBandBuilder.manifestUrlstringURL to the manifest JSON file (relative to basePath)

Viewer Options

PropertyTypeDefaultDescription
showCardbooleanfalseShow the product info card
showSwitchNodebooleanfalseShow the model switcher
showUiButtonsbooleantrueShow viewer control buttons (quality, reset view, etc.)
showConfiguratorbooleanfalseShow the generic configurator panel (not needed since WBB has its own)
showZoomButtonsbooleantrueShow +/- zoom controls
enableZoombooleantrueAllow scroll/pinch zoom
hideWbbUibooleantrueHide the built-in Wedding Band panel; set to false to show it
Container Sizing & Mobile Layout

Container Sizing

The viewer fills its container. Make sure the container has explicit dimensions:

css
/* Full viewport */
#viewer-root { width: 100vw; height: 100vh; }

/* Fixed size */
#viewer-root { width: 800px; height: 600px; }

/* Responsive (4:3 aspect ratio) */
#viewer-root { width: 100%; height: 0; padding-bottom: 75%; position: relative; }

DANGER

The viewer fills its container. If the container has zero height, nothing renders. Always set height explicitly:

html
<div id="viewer" style="width: 100%; height: 600px;"></div>

This is the most common cause of a blank viewer.

Mobile Responsiveness

The built-in panel automatically switches to a stacked layout on screens narrower than 768px. The 3D viewer sits on top and the configuration panel goes below, each taking 50% of the viewport height. Tab labels collapse to icons only.

URL Parameters

The viewer page accepts these query parameters:

ParameterDefaultDescription
manifestwedding-band-project.jsonURL to the manifest JSON file
basePath(viewer page directory)Base URL for resolving asset paths
uitrueSet to false for headless mode

Next Steps