Kivicube Web Plugin is an iframe-based integration layer for published scenes and collections used to build AR and XR experiences. The host page owns the iframe, page UI, and event listeners; Kivicube owns the inner experience and exposes a public runtime bridge through iframe-plugin.js. Use this skill from an external integrator's point of view: public script URL, public events, public open props, framework wrappers, and public SceneApi.
Common trigger phrases this skill should match well:
text
Host page HTML/CSS/JS
-> load https://www.kivicube.com/lib/iframe-plugin.js
-> open a scene or collection into an <iframe>
-> listen on the iframe for load/ready/progress/tracked/openUrl/error...
-> for scene pages, read event.detail.api
-> call async SceneApi methods across the iframe boundary
-> Kivicube runtime updates objects, media, camera, and rendering
Key split:
iframe embed: fastest path, no plugin events, no runtime API.SceneApi.ready.detail.api is not a stable collection runtime API. If you need per-scene runtime hooks inside a collection, read references/patterns.md and references/integration.md for sceneReady.TaskPublic entry pointPlain embed with no customizationdirect iframe embed with a published scene or collection URLOpen a scene manuallyopenKivicubeScene()Open a collection manuallyopenKivicubeCollection()Auto-open before DOMContentLoadediframe id + scene-id or collection-idKeep framework components in control of DOM attrsopenKivicubeScene(..., false) / openKivicubeCollection(..., false)Start from Vue 3 or Reactreferences/examples.md framework examplesReact to loading or scan progressiframe events: downloadAssetProgress, loadSceneStart, tracked, lostTrackGet the runtime APIiframe ready event, then event.detail.apiFind or move an objectgetObject(), setPosition(), setRotation(), setScale()Add runtime contentcreateImage(), createGltfModel(), createVideo(), then add()Clean up runtime objectsremove(), destroyObject(), destroyKivicubeScene()Switch camera or take a photoswitchCamera(), takePhoto()Forward host clicks into the scenedispatchTouchEvent()Skip cloud recognitionskipCloudar()Diagnose permissions, autoplay, or CORS failuresreferences/troubleshooting.md
SceneApi immediately; collection runtime control is narrower and event-driven.openKivicubeScene() and openKivicubeCollection() as async. This matters most when modifyIframe=false is used in framework wrappers.hide-start, scene-id, or similar attrs later does nothing until the scene or collection is opened again.SceneApi methods should be awaited.three.js objects. Never mutate handle.position or similar fields directly.loadSceneEnd is usually the safest point for bulk object queries, runtime additions, and event registration that depend on scene content already existing.destroyKivicubeScene() or destroyKivicubeCollection() before reusing the iframe for another scene or collection.hideStart is high risk for autoplay and permission flows. Prefer branded host UI that still preserves an explicit user gesture.image2d-tracking, cloud-ar, and web3d. Do not present face-ar, body-ar, landmark, plane, roam, audio APIs, or custom animation APIs as part of the stable Web plugin surface.html
<script src="https://www.kivicube.com/lib/iframe-plugin.js"></script>
<iframe id="sceneHost" title="Kivicube scene"></iframe>
<script>
async function main() {
const iframe = document.getElementById('sceneHost');
await kivicubeIframePlugin.openKivicubeScene(iframe, {
sceneId: 'YOUR_32_CHAR_SCENE_ID',
});
iframe.addEventListener('ready', async (event) => {
const api = event.detail.api;
const obj = await api.getObject('rabbit');
if (obj) await api.setObjectVisible(obj, true);
});
}
main().catch(console.error);
</script>
Then branch by need:
references/integration.mdreferences/patterns.mdreferences/scene_objects_reference.mdreferences/media_animation_reference.mdreferences/rendering_camera_reference.mdreferences/examples.mdreferences/best_practices.mdreferences/troubleshooting.mdTreat the public Kivicube Web plugin surface as the source of truth:
event.detail.api on scene pages and call async SceneApi methods