Quickstart
Add Room Viewer to a product page with a script tag, from npm or as a React component.
This page adds a View in your room button to a rug's product page. Other types differ only in the data they take: see Compare types.
Get a key and allow your site
- In the Rugs dashboard, open Dashboard → Widget code and copy the
data-keyvalue: your publishable key, starting withpk_live_. For wall art it is the Wall Art dashboard, Your website → Get code; for flooring and wallcovering the Flooring dashboard. - Add your site's host, and
localhostwhile you develop, to your allowed domains, under Settings → Domains in the same dashboard. Room Viewer does not load on other hosts. - Copy the rug's object id, which Room Viewer calls
tinuuid: in the Rugs dashboard's list of rugs it is the Object ID column, also under Copy object ID in the row's menu. Each size of a rug has its own.
Add Room Viewer
Pick how your site is built. The portal remembers your choice on every page.
Load the script once, anywhere on the page. It opens Room Viewer for any element marked with data-vizbl-room-viewer-dialog, including elements added to the page later.
<script defer src="https://cdn.vizbl.com/@vizbl/room-viewer/dist/room-viewer.embed.min.js"></script>Mark the button and give it the product's data:
<button
type="button"
data-vizbl-room-viewer-dialog
data-vizbl-room-viewer-api-key="pk_live_YOUR_PUBLISHABLE_KEY"
data-vizbl-room-viewer-type="rugs"
data-vizbl-room-viewer-name="Kilim Terracotta"
data-vizbl-room-viewer-tinuuid="YOUR_OBJECT_TINUUID"
>
View in your room
</button>The script brings its own copy of React, so it works on any site, whatever framework the page uses.
Replace pk_live_YOUR_PUBLISHABLE_KEY with your key and YOUR_OBJECT_TINUUID with the rug's object id.
Check that it works
Open the page on an allowed host and choose View in your room. Room Viewer asks for a room: pick one of the built-in rooms or upload a photo, and the rug appears on the floor. If nothing opens, see Troubleshooting.
Next steps
- Compare types: wall art, flooring and wallcovering.
- Language and units: the widget's language and its units.
- Options: every option, for the script tag, JavaScript and React.