Comment on page

Edit Code

Learn how to edit code and parse data in your JavaScript project.
Now that you are able to use our JavaScript SDK, it's time to build a web app.

SDK Code Example

You can find a robust open-source code example on our GitHub page.
This example project utilizes the echo3D JavaScript SDK to allow users to interact with the echo3D API via JavaScript code.

Setup and Run

  1. 1.
    Register for an account.
  2. 2.
    Add 3D models, videos, and images to the console.
  3. 3.
    Open a new terminal.
  4. 4.
    Run the following in the terminal:
  • git clone
  • cd echo3D-JavaScriptSDK-Example-Project
  • start echo3D-JavaScriptSDK-Example.html
  1. 5.
    Copy your API key from the top of the console and paste it into the application.
  2. 6.
    Optionally do the same for the secret key on the Security page of the console, if your project has it enabled.
  3. 7.
    Click Load Key. This will allow you to keep making API calls from the same API key.
  4. 8.
    Copy an entry ID by clicking the icon next to the name of any model you have uploaded to the console and paste it into the application.
  5. 9.
    Outputs of API calls will display as JSON in the center textbox.

Video Tutorial

Simple Code Example

Now that you are able to successfully fetch data into JavaScript, it's time to parse the data in your code.
You can iterate over all entries in the fetched database and parse them based on the data structures detailed in our API. For example:
/* Parse echo3D database */
var entries = []
for (let entry of db) { // Iterage over all database entries
// Parse entry
var srcFile = "" + apiKey + "&file=";
var typeFile = entry['hologram'].filename.toLowerCase().split('.').pop();
switch (entry['hologram'].type) {
srcFile += entry['hologram'].storageID;
switch (typeFile) {
case 'glb':
srcFile += entry['hologram'].storageID;
case 'gltf':
case 'obj':
case 'fbx':
srcFile += entry['additionalData'].glbHologramStorageID;
// Parse additional data
var x = (entry['additionalData'].x) ?
parseFloat(entry['additionalData'].x) : 0;
// Do something with the entry