Skip to content

Install via CDN / script tag

You don’t have to use npm. Every connector also ships a standalone global (IIFE) bundle you can drop onto a page with a single <script> tag — ideal for the Babylon Playground, CodePen, a CMS, or any page where you can’t run a bundler. The bundle exposes a window.Uptimizr global and never bundles the engine (your page already provides Babylon/three/PlayCanvas).

ConnectorBundle fileGlobal exposed
Babylon.jsuptimizr-babylon.global.jswindow.Uptimizr
Babylon Liteuptimizr-babylon-lite.global.jswindow.Uptimizr
three.jsuptimizr-three.global.jswindow.Uptimizr
PlayCanvasuptimizr-playcanvas.global.jswindow.Uptimizr
A-Frameuptimizr-aframe.global.jswindow.UptimizrAframe (registers the uptimizr component)
Replayuptimizr-replay.global.jswindow.UptimizrReplay

The standalone bundle is just a static file, so serve it however you like:

  • From a public npm CDN — because the connectors are published to npm, a CDN like jsDelivr or unpkg can serve the bundle straight from the package:

    <script src="https://cdn.jsdelivr.net/npm/@uptimizr/babylon/dist/uptimizr-babylon.global.js"></script>
    <!-- or pin a version: .../npm/@uptimizr/babylon@0.1.0/dist/uptimizr-babylon.global.js -->
  • From your own collector / static host — self-host the file (any static host, object store, or CDN works) and point the <script> at it. The local playground serves it at /uptimizr-babylon.global.js.

Inject the script through the DOM (this also sidesteps any TypeScript/import rewriting on the host page), then call trackScene once the engine scene exists:

<script>
const s = document.createElement("script");
s.src = "https://cdn.jsdelivr.net/npm/@uptimizr/babylon/dist/uptimizr-babylon.global.js";
s.onload = () => {
Uptimizr.trackScene(scene, {
projectId: "your-project-id",
endpoint: "https://collect.example.com",
meta: { sceneId: "playground" },
});
};
document.head.appendChild(s);
</script>

Uptimizr.trackScene(...) returns the same client as the npm path, so you can read client.sessionId, emit custom events with client.track(...), change scenes with client.setScene(...), and client.stop() — everything in the configuration reference works identically.

The replay bundle exposes window.UptimizrReplay with a one-call replayInScene helper — see the session replay guide.