Skip to main content

PublicViewer

The viewer as an anonymous visitor sees it, addressed by slug. Room and floor selection and the language switcher remain; every authoring control is gone. Reads through tours.getBySlug(slug).

A tour has a slug only while its visibility is PUBLIC. When the slug no longer resolves — the tour was made private, or the link is stale — the component renders its own unavailable state.

Props

PropTypeDescription
slug (required)stringPublic slug, from PropertyItem.slug.
initialScanIdstringPanorama to open on. Defaults to the tour's defaultScanId.

Example

<PublicViewer slug={slug} />

Publishing a tour

Set visibility to PUBLIC to mint the slug, and read it back from the response:

const updated = await NTController.tours.update(tourId, { visibility: "PUBLIC" });
// updated.slug is now set — route to it

Do not assume a slug's value or cache it indefinitely. Setting the tour PRIVATE revokes it.