18 Jun 2025

Always use versioning with the Viewer

This is something that people might run into if they are referencing the latest version of the Viewer SDK, i.e. use an asterisk (*) in the URL:

<script src="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/viewer3D.min.js"></script>

Sometimes an unexpected behaviour change may get introduced in a new version of the Viewer that could affect your app.
To avoid that, you should always stick to a specific version that you tested, e.g.:

<script src="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.108.0/viewer3D.min.js"></script>

Of course, you should reference the same version of the stylesheet as well, e.g. in the case of the above sample it would be:

<link rel="stylesheet" href="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.108.0/style.min.css" type="text/css" />

We blogged about this topic many times before:
https://adndevblog.typepad.com/cloud_and_mobile/2015/07/always-use-versioning.html
https://adndevblog.typepad.com/cloud_and_mobile/2016/09/forge-viewer-always-use-versioning-in-production-code.html
https://aps.autodesk.com/blog/versioning-your-viewer-based-app

Unfortunately, the above is not obvious if you only look at the getting started guide, tutorials, and samples, whose purpose is to just get you up and running or highlight a specific functionality, while keeping things as simple as possible. They are not showing a production application whose downtime could effect lots of users.

Related Article