In-room AR and try-on: what your page needs
Holostep can place a configured product in the shopper's room from the page itself, without leaving for a separate AR app. This page lists what your page, your embed and your headers need so that it works. Most pages need nothing for in-room AR. Try-on and photo capture need a one-time header change and, for try-on, a button.
In-room AR (placing a product in the room)
No tenant code is needed for calls without a GLB file. The activateAR() call you already make keeps its signature and its meaning. When your account is enabled for in-page AR, that call opens the in-page presenter on phones that support it and falls back to the native presenter (Scene Viewer or Quick Look) everywhere else, exactly as today.
What your page needs:
Permissions. In-room AR uses only the
xr-spatial-trackingfeature. Its default allowlist isself, so a page served from your own origin needs noPermissions-Policychange. Acamera=()header does not block in-room AR. If your page embeds the viewer in an iframe and itsPermissions-Policynamesxr-spatial-trackingorfullscreen, include the configurator origin in those allowlists (see the try-on section for the form), or the shopper gets the native presenter.Iframes. When the viewer runs inside an iframe, the iframe element must allow the feature and fullscreen:
html<iframe src="https://your-configurator.example" allow="xr-spatial-tracking; fullscreen"></iframe>Without
fullscreen, the browser refuses the AR session inside the iframe and the shopper gets the native presenter instead. If you plan to enable try-on or capture later, addcamerato the list now:allow="xr-spatial-tracking; camera; fullscreen".Keep the
?holoXrquery parameter. When a shopper comes back from AR on another device or from the hosted page, the return URL carries?holoXr=<code>. Holostep reads it on load, restores the configuration and emits thexr:ctaevent. A router or redirect that strips unknown query parameters breaks that return.
Good to know (no action)
- Objects you detach and re-add. Some pages remove a backdrop or helper objects before calling
activateAR()and add them back when the call resolves. Keep doing that if you want to; it needs no change. While an AR session holds the scene, objects added back are queued or hidden until the session ends, so they never appear in the shopper's room. - Fullscreen. Entering AR ends your page's own fullscreen, and it is not restored. If your page runs the viewer fullscreen, listen for the
xr:session-endevent and ask for fullscreen again from the shopper's next tap; browsers require a tap for that. - Anti-aliasing. A viewer configured with
antialias: falserenders without anti-aliasing in AR too. - Auto-launch pages. A page that calls
activateAR()on load, without a tap, always gets the native presenter. The in-page presenter needs the tap that the browser requires for an AR session. - Calls that pass a GLB file.
activateAR({ glbUrl })keeps the native presenter with that file, as today. To get the in-page presenter, callactivateAR()withoutglbUrlwhensession.info().ar.presenterreadsholostep-webxr.
Try-on and photo capture
Try-on (a product on the shopper's face or feet) and photo capture use the camera from the page. Before Holostep enables either for your account, your page needs:
The camera feature, in two places:
- The configurator app's own response. Holostep changes
camera=()tocamera=(self)in the app's headers when your account enables try-on or capture. Nothing for you to do. - Your page, if it embeds the configurator in an iframe. The iframe needs
camerain itsallowlist. If your page also sends its ownPermissions-Policy, every feature it names must include the configurator's origin, and likewise forxr-spatial-trackingandfullscreenif your header names them.camera=(self)on your page blocks the iframe even withallow="camera": the browser applies the parent's allowlist before it reads the iframe'sallow. A page that sends noPermissions-Policyneeds only the iframeallowlist.
httpPermissions-Policy: camera=(self "https://your-configurator.example"), microphone=(), geolocation=()html<iframe src="https://your-configurator.example" allow="xr-spatial-tracking; camera; fullscreen" ></iframe>- The configurator app's own response. Holostep changes
Content Security Policy. Try-on and capture run a worker from a
blob:URL and load WebAssembly. If your page sends a CSP, it must allowworker-src blob:and'wasm-unsafe-eval'inscript-src. When either is missing, the shopper is routed to the hosted page and the integrator gets a console error. In-room AR needs neither.A Try-on button that calls
tryOn()where you want try-on offered. The in-room AR button is not reused for it.
Holostep checks the camera header only for accounts that have try-on or capture enabled. Pages that offer in-room AR alone keep camera=() and pass.
Checklist
| Feature | Header | Iframe allow | CSP | Code |
|---|---|---|---|---|
| In-room AR | none (an embedding page that sends the header lists the configurator origin) | xr-spatial-tracking; fullscreen | none | none |
| Try-on, capture | configurator app: camera=(self) (Holostep); embedding page with a header: camera=(self "<configurator origin>") | xr-spatial-tracking; camera; fullscreen | worker-src blob:, 'wasm-unsafe-eval' | a Try-on button |