# Realsee immersive VR template 2.0.1

This is ONE template project and ONE archive with React, Vue and native TypeScript choices. Read [the manifest](./manifest.json), download its archive and verify its SHA-256 before extracting into a new directory. Preserve package-lock.json and LICENSE. Resolve relative links against this guide URL. MCP and a standalone Realsee CLI are not provided.

## Choose a scene source

If the user has not specified a source, ask first: “Do you want to try the Public Demo or choose a VR scene from your Team?” Wait for their choice. Use the Public Demo without authorization. For a Team scene, follow the Team setup and scene selection steps below after starting the starter.

## Choose the UI and run

Use Node 24. Ask which framework the user prefers unless their request already chooses React, Vue or native TypeScript. From realsee-immersive-vr, run npm run setup -- --framework react, substituting vue or typescript when selected. This only updates the local .starter.json; it must not touch .env. Then run npm ci, npm run check, npm run build and npm run dev. Read README.md and AGENTS.md. Keep the process running and report its actual local URL. Do not generate separate repositories for different frameworks.

## Verify the immersive public tour

No account or credentials are required. The app must open a real full-screen Five SDK scene automatically. Check that it reaches Ready, drag to look around, move through the space, switch Panorama to Top view and back, and check fullscreen. Do not add a reset button, R shortcut, developer dashboard, API-debug sidebar or activation click. A successful build or canvas element is not proof of rendered content. Report browser verification only when performed. Network access to public images/models and WebGL are required.

## Extend the selected framework

The native UI entry is src/frameworks/react/App.tsx, src/frameworks/vue/App.vue or src/frameworks/typescript/main.ts. The shared lifecycle is src/experience.ts and styling is src/styles.css. Preserve browser-only rendering, ResizeObserver cleanup, event disposal and current-view preservation on a failed scene change. Run setup again to select another UI in the same project.

## Authorize and choose a Team scene

Run npm run configure -- --device only when the user requests their own spaces. Run the helper in the user’s local environment. It tries to open the verified authorization URL in the default browser. Show the user the verification URL and eight-character code so they can open it themselves if the browser is unavailable. Keep the process running while they sign in, choose their Team and app, verify the Team shown beside the app, and authorize. Never approve for the user. The helper writes the authorized local server .env and preserves existing credentials. Never request secrets in chat, print .env or private keys, expose tokens to frontend code or use VITE_ credential variables. If authorization is unavailable, create .env from .env.example only if absent, give the user its absolute path and wait for manual local configuration.

If the portal prompt already specifies a Team scene resourceCode, restart the local server after authorization and read its /api/team/vrs pages until you find an exact match. Use the fresh sceneHandle and the name from that authorized result to open the local viewer at /#scene=<encoded handle>&name=<encoded name>&confirmed=1&flow=<new UUID>. Use a fresh UUID for this run and check /api/team/confirmed-scene?flow=<same UUID> after the viewer loads. The user's portal selection is their confirmation. If the code is absent, explain that it is unavailable to the authorized App and open the picker below. Do not substitute another scene.

If a Team scene has not already been selected, restart the local server after authorization and immediately open its URL with ?scene-picker=1&flow=<random UUID>. Generate a fresh flow ID locally and retain it in this conversation. Use the clickable scene picker page as the default rather than a chat question. It lists the authorized Team directory with search and cover images, opens a live interactive VR preview, and lets the user confirm with Use this scene. Keep the same browser tab observable if your host supports browser control. After the user confirms, the viewer opens the selected VR automatically. Poll GET /api/team/confirmed-scene?flow=<same ID> on the local starter while the user chooses. Null means there is no confirmed scene yet. A result supplies the actual scene name, resource code and a short-lived local scene handle. Use that result to continue in the same project and tell the user which scene opened. Do this even when you cannot observe the browser. Never ask for the scene name again or treat a preview as a selection. Keep the directory and viewer on the local server; never upload them or copy credentials into a prototype.

Token exchange, a successful directory read, an empty list, API errors and a rendered Team scene are separate results. Refresh an expired directory selection. Never substitute public Demo data and call it Team data. No app creation, uploads or write APIs are part of this template.

## Read data for the requested creation task

Use the confirmed scene as the project context. Read only what helps with the user's next request. For example, a guided tour can use observer indexes and the initial camera from the selected Work. Top-view interactions can use the documented Five SDK Topview mode and scene geometry. Read the Work with POST /api/team/work and the confirmed scene handle on the local backend. Work expires. Every project you create with Team data must request fresh Work on the server for each scene open or reload, even if the same scene was previously selected. The server must recheck access, call the upstream VR API at runtime, and return only the payload the viewer needs through its own authenticated endpoint with Cache-Control: no-store. Keep upstream calls, AK/SK and access tokens server-side. Do not save live Work in source, build output, static fixtures or persistent browser storage. If Work or its asset URLs expire while the scene is open, request fresh Work through the server and retry loading. Summarize only the required fields. For annotations or other data absent from the Work, consult the [API Reference](../../api-reference) and confirm that the authorized app can read the documented operation. Tell the user when data is unavailable instead of filling in invented details. Keep Work, tokens and credentials off external tools and out of source control.

## Save and deploy the result

When the user is happy with the local preview, offer to save the project in a hosted Git repository and publish it. Explain these as two steps: a repository stores the source and its version history, and a deployment builds the code and gives the user a web link. Present decisions with Agent UI when available. Use selectable options with one plain-language explanation each, then show the next step only after the user chooses. Fall back to a short numbered list. Avoid asking again when the user's choice is already known.

1. **Decide who can see it.** Offer a public demo built from approved public assets, or keep the Team scene local. The Starter's Team API is bound to localhost. For a hosted private Team project, require a separately verified backend with visitor authentication and scene-level authorization before publishing. Do not upload Team Work, private covers, signed handles, credentials or .env files. Confirm the user has rights to publish the assets and check the starter's LICENSE for the intended use.
2. **Choose where to save the code.** Offer GitHub, GitLab or an existing compatible repository. Explain that GitHub is a common choice for new projects and that GitLab is useful when the user's team already hosts its code there. Default new repositories to private. Guide the user to sign in, create a blank repository in their own account or approved organization, and connect it to the existing local project. Explain that a commit saves a version and a push sends it to the repository. Inspect the changes and destination first, preserve any existing remote, and ask before pushing code. Keep the selected framework configuration and lockfile with the project. [GitHub guide](https://docs.github.com/en/migrations/importing-source-code/using-the-command-line-to-import-source-code/adding-locally-hosted-code-to-github) · [GitLab guide](https://docs.gitlab.com/user/project/)
3. **Choose a web host.** For the public static build, use Node 24, npm ci for installation, npm run build for building, and dist/client for the website files. Build and validate those files locally before connecting a hosting account. Show only options that support the user's repository. Explain any required permissions and paid settings before asking the user to proceed.
   - **Vercel** builds and publishes a Vite website from a connected repository. In the dashboard, create a project, import the GitHub or GitLab repository, set the framework to Vite and confirm the output directory is dist/client. Confirm Node 24 and the build settings before deploying. [Vercel Git guide](https://vercel.com/docs/git) · [Project settings](https://vercel.com/docs/project-configuration/project-settings)
   - **Zeabur** hosts a project as one or more services. Create a project, add a service from the connected GitHub repository, and set ZBPACK_BUILD_COMMAND to npm run build and ZBPACK_OUTPUT_DIR to dist/client. Confirm that the build uses Node 24. When the service is ready, assign a domain in its networking settings. [Create a Zeabur service](https://zeabur.com/docs/en-US/deploy/create/create-service) · [Build settings](https://zeabur.com/docs/en-US/guides/nodejs)
   - **Cloudflare Pages** publishes static site files and can rebuild when the chosen Git branch changes. In Workers & Pages, create a Pages project with Git integration, authorize the selected GitHub or GitLab repository, choose the production branch, and set the build command to npm run build, output directory to dist/client and NODE_VERSION to 24. [Pages Git integration](https://developers.cloudflare.com/pages/configuration/git-integration/) · [Build environment](https://developers.cloudflare.com/pages/configuration/build-image/)
4. **Set the allowed VR domains before publishing.** Right after the platform choice, explain that Allowed VR domains (allow_host, stored as vr_allow_hosts) controls where the App's VR can render. If the project uses a Developer app, reserve or identify the exact deployment hostname first. Ask for the hostname in Agent UI if it is still unknown. Open Dashboard → Apps → the selected Team's App → Integration → Allowed VR domains. Guide the App owner to add the production hostname and any separately approved preview host. Enter hostnames only, without a scheme, port or path. Keep existing entries and check the plan's domain limit. If browser assistance is available, help fill the exact approved hostname and have the owner review and save it. Confirm the saved entry before publishing. If the host is not assigned yet, reserve a project or custom domain before publishing, or wait to enable Team VR on that deployment until the exact hostname is saved. The bundled Public Demo works without an App allowlist. An allowed domain alone does not authorize publishing a private Team scene.
5. **Confirm and verify.** Before publishing, show the exact repository, branch, selected host, verified App domains when applicable and resulting visibility. Let the user handle sign-in, permission grants and billing. After deployment, open the hosted URL in a fresh browser and check that the intended scene reaches Ready. Give the user the working URL and explain how to update by pushing the next approved commit, and how to restore a known-good deployment or revert the commit. Report the actual build or runtime error if verification fails.

## Optional SDK examples

React includes a separate ?sdk-examples=1 learning page. The extensions/ directory contains independently locked Dnalogel and Vreo examples. Install that optional example only when requested; its default port is 4188. Live/RTC are not included there. Keep these learning surfaces out of the default immersive tour.

## Handle blockers

Preserve user files, environment configuration, LICENSE, the lockfile and exact compatible dependencies. Stop if the archive checksum differs. Report Node, install, build, network, WebGL or API failures at their real stage. Never conceal failures with synthetic scene output. This current-only distribution intentionally does not retain old starter versions.
