<viewer-3dvue> is a native Web Component. It works in any WordPress context — Elementor HTML widget, Gutenberg block, shortcode, custom PHP template, CPT with ACF. No dedicated plugin, no dependency.
add_action('wp_enqueue_scripts', function() { wp_enqueue_script( 'viewer-3dvue', 'https://cdn.jsdelivr.net/gh/3dvue/api@v4/viewer-3dvue-min.js', [], null, true ); });
<viewer-3dvue name="myViewer" src="https://app.3dvue.fr/view?p=AB01-CD02" ></viewer-3dvue> <!-- That's it. -->
WordPress is flexible — the component adapts to your stack. Via wp_enqueue_script(), an Elementor widget, a shortcode or directly in a PHP template. Your choice.
The recommended method is wp_enqueue_script() in functions.php. You can also include it via WPCode (global snippet), or directly in an Elementor HTML widget if you don't want to touch any files.
<script> tag and activate it on all pages or only product pages.
// 1. Via functions.php (recommended) add_action('wp_enqueue_scripts', function() { wp_enqueue_script('viewer-3dvue', 'https://cdn.jsdelivr.net/gh/3dvue/api@v4/viewer-3dvue-min.js', [], null, true); }); // 2. Via WPCode — global HTML snippet <script src="https://cdn.jsdelivr.net/gh/3dvue/api@v4/viewer-3dvue-min.js"></script> // 3. In an Elementor HTML widget <script src="https://cdn.jsdelivr.net/gh/3dvue/api@v4/viewer-3dvue-min.js"></script> <viewer-3dvue name="myViewer" src="..."></viewer-3dvue>
Paste the tag in your PHP template, in an Elementor HTML widget, or via a shortcode. For CPTs with ACF, you can conditionally display it based on a custom field value.
<?php // Retrieve the configurator ID from an ACF field $viewer_id = get_field('configurateur_3d_id'); ?> <?php if ($viewer_id) : ?> <viewer-3dvue name="myViewer" src="https://app.3dvue.fr/view?p=<?php echo esc_attr($viewer_id); ?>" ></viewer-3dvue> <?php endif; ?>
WordPress has no native variation system — everything is done via your custom HTML components. Add the viewer-3dvue attributes to your product configuration buttons or selects. No JS to write.
<!-- Custom colour buttons --> <button viewer-3dvue="myViewer" viewer-3dvue-clic="setMaterial" viewer-3dvue-meshs-materials='{"1":"0n","2":"1a"}' >Natural oak</button> <!-- Finish select --> <select viewer-3dvue="myViewer" viewer-3dvue-change="setMaterial" viewer-3dvue-mesh="1" > <option value="0n">Matt black</option> <option value="1a">Matt white</option> <option value="2b">Oak</option> </select>
The component integrates into every WordPress context. Choose the method that suits your stack.
functions.php to insert it anywhere from the editor.// In functions.php add_shortcode('configurateur3d', function($atts) { $id = $atts['id'] ?? ''; return '<viewer-3dvue name="v" src="https://app.3dvue.fr/view?p=' . esc_attr($id) . '"></viewer-3dvue>'; } ); // In the editor: // [configurateur3d id="AB01-CD02"]
<!-- Gutenberg Custom HTML block --> <viewer-3dvue name="myViewer" src="https://app.3dvue.fr/view?p=AB01-CD02" ></viewer-3dvue> <!-- Variation buttons in the same block --> <button viewer-3dvue="myViewer" viewer-3dvue-clic="setMaterial" viewer-3dvue-meshs-materials='{"1":"0n"}' >Black</button>
Full programmatic control from your WordPress JS — compatible with all builders and frameworks used on WordPress.
// functions.php — pass ACF data to JS wp_localize_script('my-script', 'ViewerConfig', [ 'viewerId' => get_field('configurateur_id'), 'materials' => get_field('materials_map'), ]); // my-script.js const viewer = document.querySelector('viewer-3dvue'); viewer.setMaterial(ViewerConfig.materials);
const viewer = document.querySelector('viewer-3dvue[name="myViewer"]'); // Change materials viewer.setMaterial({ "1": "0n", "3": "2b" }); // Load another model viewer.loadModel("AB01-CD02"); // Capture the render (e.g. order preview) viewer.captureToBase64(); viewer.addEventListener("onCaptureBase64Complete", (e) => { console.log(e.detail.base64); });
API reference, HTML attributes, WordPress PHP examples, shortcodes. Everything is documented and kept up to date.
View documentationNo automated ticketing. You speak directly to Matthieu, the developer who designed the API. Response within 24h.
Book a callTest the configurator before integrating. See what your customers will see on your WordPress site.
View demoYou manage the code on the WordPress side, we handle everything else — modelling, materials, configuration. In 30 minutes we tell you what we can do.