NAV Navigation
JavaScript

Viewer 3D API

Technology preview

We are currently working on providing pure JavaScript APIs for the Bimsync viewers. The current version of the JavaScript API is a technology preview and should not be used in production environments. Please consider using our jQuery Plugin until we have a stable version of the pure JavaScript API available.

Deprecation notice

We are unifying all our APIs under one host, api.catenda.com. We'll be updating the docs in the coming days to reflect the new URL mappings. Existing URLs pointing to https://api.bimsync.com or https://opencde.bimsync.com will continue to work until the sunset date of June 1st 2025.

The old -> new mappings by API are as follows:

Getting started

The Viewer 3D API allows developers to embed the Bimsync 3D viewer in their applications.

Release channels

We use release channels to slowly roll out updates to the Viewer 3D API.

Which channel should I use?

How to specify channel

You can select the channel to use by passing a query parameter to the URL when loading the Viewer 3D API:

<script src="https://api.catenda.com/js/v1/viewer3d"></script>

or

<script src="https://api.catenda.com/js/v1/viewer3d?release=stable"></script>

<script src="https://api.catenda.com/js/v1/viewer3d?release=beta"></script>

<script src="https://api.catenda.com/js/v1/viewer3d?release=dev"></script>

Initializing

1. Add container element

<div id="viewer-container"></div>

2. Inline load the loader script using a script tag

<script src="https://api.catenda.com/js/v1/viewer3d"></script>

3. Load the viewer and create a Viewer3D instance

<script>
    // Load the Viewer 3D API.
    bimsync.load();

    // Set a callback to run when the Viewer API is loaded
    bimsync.setOnLoadCallback(() => {
      var viewer = new bimsync.viewer3d.Viewer3D(document.getElementById('viewer-container'));
    });
</script>

Reference

Visit the reference documentation for detailed documentation on the Viewer3D class and related methods and interfaces.

TypeScript

A type declaration file for the Bimsync viewers is available for download.

Download type declaration file (bimsync.d.ts)