Sketchfab for Developers
Download API Libraries
glTF Libraries
Many libraries are available in C, C++, C#, Java, etc. for reading glTF files.
See the glTF repository on Github for the full list.
JavaScript libraries
Sketchfab Importer for web apps
The Sketchfab Importer for web apps is a web widget you can embed into your app.
The importer implements:
- user authentication
- search
- download requests
This allows you to focus on implementing archive download and glTF reading.
Installing the importer
Add a container for the widget and insert the script in your web app:
<div class="skfb-widget"></div>
<script src="https://apps.sketchfab.com/web-importer/sketchfab-importer.js"></script>
Then initialize the importer:
var el = document.querySelector('.skfb-widget');
var skfbWidget = new SketchfabImporter(el, {
onModelSelected: function(result) {
//Do something with the result
console.log(result);
}
});
The SketchfabImporter
constructor takes 2 arguments:
- a DOM element where the importer will be embedded.
- an object containing options:
onModelSelected
: a callback function that will be called every time the user selects a model for download. The callback will be invoked with the result of a download request.