@neurodyn/core-ar
v0.2.2
Published
Framework-agnostic Core AR runtime for the Vizbl and Arizo Web Components.
Downloads
841
Readme
@neurodyn/core-ar
Framework-agnostic Core AR runtime for the Vizbl and Arizo Web Components.
CDN installation
The embed bundle follows the same self-registering CDN contract as Room Viewer and Model Viewer. Load it once and then add any number of branded elements:
<script
defer
src="https://cdn.neurodyn.ai/@neurodyn/core-ar/dist/core-ar.embed.min.js"
></script>
<vizbl-core
api-key="PUBLIC_WIDGET_KEY"
type="ar-viewer"
object-id="OBJECT_TINUUID"
variant-id="OPTIONAL_MATERIAL_HID"
>
View in my room
</vizbl-core>The credential attribute is api-key, not key. React reserves key for its
own reconciliation and does not forward it to Custom Elements.
The tag selects the tenant:
<vizbl-core>uses Vizbl;<arizo-core>uses Arizo.
Production is the default. Add the boolean dev attribute only for the dev
API and viewer:
<arizo-core
dev
api-key="PUBLIC_WIDGET_KEY"
type="advanced-ar"
object-id="OBJECT_TINUUID"
></arizo-core>As with every HTML boolean attribute, its presence means true; do not use
dev="false". Vizbl and Arizo elements can coexist on the same page because
each element resolves and retains its own runtime configuration.
The unversioned CDN path resolves to the latest published package version. Consumers do not install the npm package and do not call an initialization function.
Canary verification
Before a stable release, verify the package published from develop through
the canary dist-tag. Start a static server from the repository root:
python3 -m http.server 4173 --directory packages/core-ar-widget/examplesThen open http://localhost:4173/cdn-smoke.html. The page loads
@neurodyn/core-ar@canary by default and can also check the stable latest
channel. Add localhost to the domains allowed for the public widget key;
never commit a real key to the smoke page.
Supported types are ar-viewer, ar-one-click, and advanced-ar.
size-type="cm|inch" is supported by ar-viewer.
Package registration
Package consumers can register both branded elements explicitly:
import { registerCoreArWidgets } from '@neurodyn/core-ar'
registerCoreArWidgets()Styling
Use trigger-class to apply CSS or generated Tailwind classes directly to the
internal trigger. Tailwind projects must keep dynamic classes in their source
scan or safelist.
<vizbl-core
trigger-class="rounded-full bg-black px-6 py-3 text-white"
unstyled
api-key="PUBLIC_WIDGET_KEY"
type="ar-viewer"
object-id="OBJECT_TINUUID"
></vizbl-core>Without unstyled, these CSS variables customize the default trigger:
--core-ar-widget-background--core-ar-widget-background-hover--core-ar-widget-background-active--core-ar-widget-border-color--core-ar-widget-border-radius--core-ar-widget-color--core-ar-widget-focus-ring--core-ar-widget-font-family--core-ar-widget-font-size--core-ar-widget-font-weight--core-ar-widget-padding
Events
Both branded elements dispatch bubbling core-ar-ready and core-ar-error
events. Error details contain a safe error code, object ID, and type; the
public key is never included.
Runtime flow
The first activation uses POST /public/widget/activate-core. Its short-lived
widget session is then used for object reads and analytics. POST
/public/widget/token is only used to refresh an existing session; a transient
refresh failure falls back to a fresh activate-core request.
