echo3D
🌐 Back to website💻 Go to console📺 Watch workshop💬 Discuss on Slack
  • Introduction
  • Quickstart
    • 🔑Register
    • 💻Access the Console
    • 🎲Add a 3D Asset
    • 📤Share it with Others
    • ❔Troubleshooting
  • Web Console
    • 📦Load a Collection
    • 💼Manage Pages
      • Content Page
        • Assets and Targets
        • Add Content
        • Edit Content
        • Share Content
        • Access Permissions
        • Version Control
        • Asset Hierarchy
        • Bulk Actions on Assets
        • Asset Commenting
        • Activity Sidebar
      • Metadata & Tags Page
        • Collection Taxonomy and Asset Specific Metadata
        • How to Add and Edit Metadata
        • How to Add Associated Files and Text
      • Collections and Sharing Page
        • Users Tab
        • Groups Tab
        • Collections
        • Collection Sharing Tab
        • Asset Sharing Tab
        • Security Tab
      • Customizer Page
      • Model Editor Page
      • Scene Editor Page
    • 🚚Deliver Pages
      • Locations Page
      • Users Page
      • Insights Page
    • 🕛Optimize Pages
      • Convert & Compress Page
    • 🎓Learn Pages
      • Tutorials Page
    • 👤Account Page
      • Profile Tab
      • Email & Password
      • Plans Tab
      • Credit Usage Tab
      • Notifications Tab
      • Delete Account Tab
    • ❓Help Menu
    • ⏬Downloads
    • 🎨Themes
    • 🔎Search
  • API
    • 🧩Objects
    • 🗨️Queries
    • 📊Data
      • 📑What Metadata is Stored
    • 🔼Upload
    • 🔽Download
    • ❌Delete
    • 🌳Entry Hierarchy
    • 🔄Convert
    • 🔃Compress
    • 📁Organize
    • ⏪Version
    • ⏬Locate
    • 🔎Search
    • 🖼️Search by Image or Model
    • Share Content
  • Unity
    • 🔨Installation
    • 🧰Using the SDK
    • 🔧Script Settings
    • 📐Transforming Content
    • 👩‍💻Edit Code
    • 🤳Adding AR Capabilities
    • ❔Troubleshooting
  • Unreal 4
    • 🔨Installation
    • 🧰Using the SDK
    • 🔧Demo Project
  • Web
    • 🔨Installation
    • 🧰Using the Package
  • Scene Viewer
    • 📲Deploy Experience
    • 📐Transforming Content
    • 🔢Embed into Website or App
    • 👩‍💻Add Code
    • ❔Troubleshooting
  • AR.js
    • 📲Deploy Experience
    • 📐Transforming Content
    • 🔢Embed into Website or App
    • ❔Troubleshooting
  • FaceAR
    • 📲Deploy Experience
    • 📐Transforming Content
    • 🔢Embed into Website or App
    • ❔Troubleshooting
  • React Native
    • 📩Fetching Data
    • 👩‍💻Edit Code
    • 🤳Adding AR/VR Capabilities
    • 📐Transforming Content
  • Swift
    • 🔨Installation
    • 🔢Displaying a Model Asset
    • 🤳Adding AR Capabilities
    • 🧰Using the SDK
  • Flutter
    • 🔨Installation
    • 👩‍💻Edit Code
    • 🤳Adding AR Capabilities
  • JavaScript
    • 🔨Installation
    • 🧰Using the SDK
    • 📩Fetching Data
    • 👩‍💻Edit Code
  • Python
    • 🔨Installation
    • 🧰Using the SDK
    • 🔧Demo Project
  • NVIDIA Omniverse
    • 🔨Installation
  • Adobe Substance 3D Painter
    • 🔨Installation
  • 🧰Using the Plugin
  • Blender
    • 🔨Installation
    • 🧰Using the Add-on
  • eCommerce Sites
    • 🛒Shopify
    • 🌐Wix
  • 3D Content
    • 🎨Content Creation
    • 💎Google Poly
    • 📦Objaverse
    • 💫3D Capture Apps
      • MagiScan
      • Qlone
      • ARitize360
      • SCANN3D
      • 3D Scanner
      • Didimo Xperience
      • Scaniverse
      • Metascan3D
      • Polycam3D
      • RealityScan
Powered by GitBook
On this page
  • SDK Code Example
  • Setup and Run
  • Video Tutorial
  • Simple Code Example

Was this helpful?

  1. JavaScript

Edit Code

Learn how to edit code and parse data in your JavaScript project.

PreviousFetching DataNextInstallation

Last updated 1 year ago

Was this helpful?

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 .

This example project utilizes the echo3D JavaScript SDK to allow users to interact with the echo3D API via JavaScript code.

Setup and Run

  1. for an account.

  2. 3D models, videos, and images to the console.

  3. Open a new terminal.

  4. Run the following in the terminal:

  • git clone https://github.com/echo3Dco/echo3D-JavaScriptSDK-Example-Project.git

  • cd echo3D-JavaScriptSDK-Example-Project

  • start echo3D-JavaScriptSDK-Example.html

  1. Copy your API key from the top of the console and paste it into the application.

  2. Optionally do the same for the secret key on the page of the console, if your project has it enabled.

  3. Click Load Key. This will allow you to keep making API calls from the same API key.

  4. 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. 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.

...

/* Parse echo3D database */
var entries = []
for (let entry of db) { // Iterage over all database entries
  // Parse entry
  var srcFile = "https://api.echo3D.com/query?key=" + apiKey + "&file=";
  var typeFile = entry['hologram'].filename.toLowerCase().split('.').pop();
  switch (entry['hologram'].type) {
    case 'VIDEO_HOLOGRAM':
    case 'IMAGE_HOLOGRAM':
      srcFile += entry['hologram'].storageID;
      break;
    case 'MODEL_HOLOGRAM':
      switch (typeFile) {
        case 'glb':
          srcFile += entry['hologram'].storageID;
          break;
        case 'gltf':
        case 'obj':
        case 'fbx':
          srcFile += entry['additionalData'].glbHologramStorageID;
          break;
      }
      break;
    }
    
    // Parse additional data
    var x = (entry['additionalData'].x) ? 
              parseFloat(entry['additionalData'].x) : 0;
    
    // Do something with the entry
    ...
    
  }
  
  ...

You can iterate over all entries in the fetched database and parse them based on the detailed in our API. For example:

👩‍💻
GitHub page
Register
Add
Security
data structures