Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@onirix/embed-sdk

Package Overview
Dependencies
Maintainers
0
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@onirix/embed-sdk

Onirix helper library for iframe event communication.

  • 1.13.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
463
decreased by-7.03%
Maintainers
0
Weekly downloads
 
Created
Source

Onirix Embed SDK

Version Documentation Twitter: onirix

Take control of your Onirix augmented reality experiences. Responds to user interaction and acts on the 3D content of the scene.

This library acts as a wrapper of window.postMessage for simplifying communication with Onirix AR experiences. Not only can you use it in the online code editor of Onirix Studio projects, you can also connect to your scene loaded in an iFrame.

Take Onirix experiences to the next level.

Full documentation available at Onirix Docs.

Install

npm install @onirix/embed-sdk

Or include the dependency within the HTML head tag:

<head>
    <script src="https://unpkg.com/@onirix/embed-sdk@1.13.0/dist/ox-embed-sdk.esm.js">
</head>

Or as ESM modules:

import OnirixEmbedSDK from "https://unpkg.com/@onirix/embed-sdk@1.13.0/dist/ox-embed-sdk.esm.js";

Usage

Just create an instance of our EmbedSDK and execute the connect method. From that moment on you will be able to subscribe to the events that occur in the scene and you will be able to execute actions on the elements of the experience.

const embedSDK = new OnirixEmbedSDK();
await embedSDK.connect();

embedSDK.subscribe(OnirixEmbedSDK.Events.ELEMENT_CLICK, (params) => {
    console.log('somebodey clicks me!', params);
});

embedSDK.enable(elementOid);

If you have embedded an Onirix Studio experience in your application through an iframe, you must pass the Html element of the iFrame to the EmbedSDK constructor.

const iframeElement = document.getElementById("<iframe_element_id>");
const embedSDK = new OnirixEmbedSDK(iframeElement);

Make sure that the iFrame is already loaded before instantiating the EmbedSDK.

See the complete list of events and actions in our documentation.

Author

👤 Onirix

Keywords

FAQs

Package last updated on 21 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc