- Docs
- Tools
The Viewer
The Viewer opens an experience from a link: view.tempusxr.com/abc123. It runs on the SDK. People scan a QR code, see a loading screen with your branding, tap Start, and the camera opens. The photo and video shutter is there, and analytics are on when you set an endpoint.
Try it: pnpm --filter @tempusxr/viewer dev, then open /demo.
How it opens an experience
- The address gives the id:
/abc123. - The Viewer fetches
{sceneBase}/abc123/scene.json(by default/s/abc123/scene.json). - The loading screen shows the branding of the scene (
meta.brand: name, logo, color) and a progress bar. The heavy parts (Three.js, the tracker) load now, not before the first paint. - A Start button. The tap is what lets the phone open the camera and play sound and video.
- The experience runs, with the shutter for photos and videos.
A scene that does not exist shows a not-found page. A scene that is not valid, or a file that cannot load, shows an error with what is wrong and a Try again button. The Viewer speaks French or English (?lang=fr, else the language of the phone).
Settings
Set them before the scripts run:
<script>
window.TEMPUSXR_VIEWER = {
sceneBase: 'https://cdn.tempusxr.com/s',
analyticsEndpoint: 'https://a.tempusxr.com/e',
};
</script>
How it is built
A small static site, apps/viewer: index.html is the main page and opens an experience, not-found.html is the page for an id that does not exist. assets/js/common.js is shared by every page (settings, language and texts, the loading and error screens), assets/js/utils.js holds the shared helper functions, and each page has its own script (page-experience.js, page-not-found.js). It is built with Vite. On Vercel, a rewrite sends /{id} to index.html.