Skip to content

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.


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.

Three components collaborate to make an embed session work:

  1. 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.
  2. 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 postMessage channel with it.
  3. 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).

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.

CapabilityIn the embed?Notes
3D scene renderingYesThe full RealityTwin viewing experience.
Camera navigation modesYesPerspective, orthographic, photosphere, third-person.
Points of Interest (view, create, edit)YesPoint-of-interest creation, editing, and placement.
Object selection and “teleport to”YesMove the camera to a specific business object.
Shareable view linksYesEncode the current camera as a compact string, then restore it later on any page load.
ScreenshotsYesCapture the current view as PNG bytes.
Live state subscriptionsYesObserve selection, hover, camera mode, POI tool state, and more.
Built-in twin UI (menus, panels, modals)NoYour host page provides all interface elements.
Editing features (drafts, measures, zones, RealityPlan Projects, CAD inspection)NoThese remain in the full RealityTwin application.
  • 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