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:
- https://api.bimsync.com/v2/... -> https://api.catenda.com/v2/...
- https://api.bimsync.com/js/... -> https://api.catenda.com/js/...
- https://api.bimsync.com/oauth/... -> https://api.catenda.com/oauth/...
- https://api.bimsync.com/oauth2/... -> https://api.catenda.com/oauth2/...
- https://opencde.bimsync.com/... -> https://api.catenda.com/opencde/...
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?
- Stable channel: The stable channel is fully tested and should be the default channel for production ready applications. It is updated every 4 to 5 weeks.
- Beta channel: The beta channel should be used to test upcoming updates.
- Development channel: The development channel can be used to try out what we are working on right now. It is regularly updated and can be subject to bugs. Don't use the development channel in production ready applications.
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:
- Stable channel: Default channel. Either ommit the parameter or use
release=stable
.
<script src="https://api.catenda.com/js/v1/viewer3d"></script>
or
<script src="https://api.catenda.com/js/v1/viewer3d?release=stable"></script>
- Beta channel: Use
release=beta
.
<script src="https://api.catenda.com/js/v1/viewer3d?release=beta"></script>
- Development channel: Use
release=dev
.
<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.