Introduction
RealityConnect Embed lets you place a live, interactive RealityTwin viewer directly inside your own web application. The twin renders in an iframe, and a lightweight JavaScript SDK (@prevu3d/realityconnect-embed) gives your page programmatic control over it — so your users get immersive 3D context without ever leaving the tools they already use.
How the embed is organized
Section titled “How the embed is organized”A few design choices are worth knowing before you start building:
- A bare viewer your page controls. The embedded twin is a 3D viewer with no built-in interface — no header, sidebar, menus, or toolbars. Your application owns all of the surrounding chrome and drives the twin through the SDK.
- Authorized through the RealityConnect API. Every embed session is authorized using your organization’s OAuth credentials — there is no anonymous embedding. Your backend requests a signed, short-lived embed URL for a given twin.
- The SDK loads and instruments the viewer. Your page hands that URL to the SDK, which injects the iframe and establishes a secure two-way channel with the twin.
- Your page drives the twin. Once the viewer reports ready, SDK commands become available to control the twin (navigation, points of interest, teleporting to an object, capturing a shareable view) and subscribe to live state from the embedded scene.
- It is the visual layer of RealityConnect. The RealityConnect API connects your systems and authorizes access, while RealityConnect Embed renders the twin and exposes it to your front-end code.
How the pieces fit together
Section titled “How the pieces fit together”Three components collaborate to make an embed session work:
- Your backend authenticates against the RealityConnect API with the Client Credentials flow, then asks the API to create a short-lived embed session for a specific twin. This is the only place where your OAuth client secret lives.
- Your front-end receives the session values from your backend and hands them to the SDK. The SDK injects an iframe pointing at the signed embed URL and opens a secure
postMessagechannel with it. - The embedded twin renders the 3D scene, executes commands sent from your page, and streams live state back (selected object, current camera mode, encoded views, and more).
What the embed exposes
Section titled “What the embed exposes”The SDK gives your page a typed API to drive the scene (camera navigation, points of interest, object teleport, view sharing, screenshots) and to subscribe to live state coming back from the twin. The complete surface — namespaces, actions, observables, and error codes — is documented in the SDK README.
The table below summarizes what the embed does and doesn’t cover today. New capabilities are added regularly, so treat this as a snapshot.
| Capability | In the embed? | Notes |
|---|---|---|
| 3D scene rendering | Yes | The full RealityTwin viewing experience. |
| Camera navigation modes | Yes | Perspective, orthographic, photosphere, third-person. |
| Points of Interest (view, create, edit) | Yes | Point-of-interest creation, editing, and placement. |
| Object selection and “teleport to” | Yes | Move the camera to a specific business object. |
| Shareable view links | Yes | Encode the current camera as a compact string, then restore it later on any page load. |
| Screenshots | Yes | Capture the current view as PNG bytes. |
| Live state subscriptions | Yes | Observe selection, hover, camera mode, POI tool state, and more. |
| Built-in twin UI (menus, panels, modals) | No | Your host page provides all interface elements. |
| Editing features (drafts, measures, zones, RealityPlan Projects, CAD inspection) | No | These remain in the full RealityTwin application. |
Common use cases
Section titled “Common use cases”- Asset-management and inspection platforms that want 3D context alongside their records
- Virtual tours and eLearning experiences
- Any web product that benefits from an embedded, navigable digital twin
Next steps
Section titled “Next steps”- Getting Started — authenticate, install the SDK, and load your first embedded twin.
- RealityConnect API — the authentication and data layer behind the embed.
- Live example — a working Vue.js integration you can inspect end to end.
@prevu3d/realityconnect-embed- Sources repository