Quick Start
Get the Model API running with your embedded Vectary project in 5 minutes.
Prerequisites
1
2
3
Step 3: Initialize the API
<script type="module">
import { VctrModelApi } from "https://app.vectary.com/studio-lite/scripts/api.js";
// Create API instance with the iframe's DOM id
const api = new VctrModelApi("vectary-embed");
// Wait for initialization
await api.init();
console.log("API ready!");
</script>4
Step 4: Make your first API call
<script type="module">
import { VctrModelApi } from "https://app.vectary.com/studio-lite/scripts/api.js";
const api = new VctrModelApi("vectary-embed");
await api.init();
// Get all objects in the scene
const objects = await api.getObjects();
console.log("Scene objects:", objects);
</script>Complete example
<!DOCTYPE html>
<html>
<head>
<title>Vectary API Demo</title>
<style>
body { font-family: sans-serif; padding: 20px; }
iframe { border: 1px solid #ccc; }
pre { background: #f5f5f5; padding: 15px; overflow: auto; }
</style>
</head>
<body>
<h1>My 3D Configurator</h1>
<iframe
id="vectary-embed"
src="https://app.vectary.com/p/YOUR_PROJECT_ID"
width="800"
height="600"
frameborder="0"
></iframe>
<h2>Scene Objects</h2>
<pre id="output">Loading...</pre>
<script type="module">
import { VctrModelApi } from "https://app.vectary.com/studio-lite/scripts/api.js";
const api = new VctrModelApi("vectary-embed");
await api.init();
const objects = await api.getObjects();
document.getElementById("output").textContent = JSON.stringify(objects, null, 2);
</script>
</body>
</html>Key points
Point
Details
Troubleshooting
Next steps
Last updated