Quickstart
Add Core AR to a product page with a script tag, from npm or in React.
This page adds a View in 3D & AR button for one model to a product page. The other modes differ only in type: see Modes.
Get a key and allow your site
- In the Core AR dashboard, open Integrations and choose Install on 3D & AR viewer or AR view. Copy the
data-keyvalue from the code: your publishable key, starting withpk_live_. - Add your site's host, and
localhostwhile you develop, to the dashboard's domains: Settings → Domains. Core AR does not load on other hosts. See allowed domains. - In the Model library, copy the model's id with Copy Object ID.
Add Core AR
Pick how your site is built. The portal remembers your choice on every page.
Load the script once, anywhere on the page. It defines <vizbl-core>, so every element on the page becomes a button, including elements added later.
<script async src="https://cdn.vizbl.com/@vizbl/core-ar/dist/core-ar.embed.min.js"></script>Put the element where the button goes:
<vizbl-core
api-key="pk_live_YOUR_PUBLISHABLE_KEY"
type="ar-viewer"
object-id="YOUR_OBJECT_ID"
></vizbl-core>Load the script with async: it then never holds up the rest of your page. 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_ID with the model's object id.
Check that it works
Open the page on an allowed host. The button shows View in 3D & AR once the model is ready; press it and the 3D viewer opens over the page. If the button stays greyed out, see Troubleshooting.
Next steps
- Modes: what each mode opens on a computer, an iPhone and an Android phone.
- Variants and camera: the colour the model opens in, and where the camera starts.
- Events: react when the button is ready or fails.